maas 0.0.10 copy "maas: ^0.0.10" to clipboard
maas: ^0.0.10 copied to clipboard

maas is an MPC network solution to serve resource as service.

example/main.dart

/*
 * Copyright (c) 2019, 2025, firmer.tech and/or its affiliates. All rights reserved.
 * Firmer Corporation PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 */

import 'package:maas/gen/index.g.dart';
import 'package:maas/index.dart';

@SPI(name: "foo")
abstract class IFoo {
  Future<String?> doc(String name, String formatter, {Context? ctx});
}

@SPI(name: "foo")
class Foo implements IFoo {
  @SPI(name: 'mpi')
  late Builtin builtin;

  @override
  Future<String?> doc(String name, String formatter, {Context? ctx}) async {
    return await builtin.doc(name, formatter, ctx: ctx);
  }
}

Future<void> main() async {
  maas();
  final vars = Proxy.spi<Vars>();
  vars.setenv('MESH_ADDRESS', 'https://127.0.0.1:443');
  final builtin = Proxy.mpi<Builtin>();
  final doc = await builtin.doc('', '');
  info('$doc');

  final foo = Proxy.spi<IFoo>();
  final docx = await foo.doc('', '');
  info('$docx');

  final codec = Proxy.spi<Codec>();
  final json = codec.encodeString(Body(codec: 'x', schema: 'y'));
  info(json);
  final body = codec.decodeString<Body>(json);
  info(body.codec ?? '');
}
0
likes
45
points
62
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

maas is an MPC network solution to serve resource as service.

Homepage
Repository
View/report issues

License

unknown (license)

Dependencies

antlr4, async, collection, decimal, flutter, flutter_localizations, grpc, http, intl, meta, path

More

Packages that depend on maas