transit-dart 0

Transit (http://transit-format.org) for Dart (https://www.dartlang.org/)

transit-dart

Dart package that implements Transit format.

Before reading this you should be familiar with the Transit format (http://transit-format.org)

Usage

Quick intro:

void main(){
    var tJson = new JsonTransitCodec();

    tJson.encode([1, true, "It is working", new TransitKeyword("x")]);
    tJson.decode('[1, true, "It is working", "~:x"]');

    tJson.encoder.register(new MyClassHandler());
    tJson.encode(new MyClass("Some_Data"));

    tJson.decoder.register("my_tag",(data) => new MyClass(data));
    tJson.decode('["~#my_tag","Some_Data"]');
}

class MyClass{
    var data;
    MyClass(this.data);
}

class MyClassHandler extends WriteHandler<MyClass>{
    String tag(MyClass obj) => "my_tag";
    rep(MyClass obj) => obj.data;
}

For more information check latest API documentation.

Type mapping

Supported built-in Dart types are: Null, bool, int, double, String, List (as array), Map (as cmap), Set, Queue (as list), Uri.

Library also provides the rest of Transit standard types: TransitKeyword, TransitSymbol, TransitBytes, TransitLink, TransitUuid, TransitTaggedValue.

Related Repositories

transit-dart

transit-dart

Transit (http://transit-format.org) for Dart (https://www.dartlang.org/) ...


Top Contributors

syslo hleumas mockturtl

Releases

-   v0.8.3 zip tar
-   v0.8.2 zip tar
-   v0.8.1 zip tar
-   v0.8.0 zip tar