threads_client 0.1.5

  • Readme
  • Example
  • Installing
  • new63

dart-threads-client #

Made by Textile Chat on Slack GitHub license Dart CI Pub Threads version

Textile's Dart client for interacting with remote Threads

Join us on our public Slack channel for news, discussions, and status updates. Check out our blog for the latest posts and announcements.

Table of Contents #

Getting Started #

In the pubspec.yaml of your project, add the following dependency:

See latest version in badge at top of README.

dependencies:
  ...
  threads_client: "^0.x.x"

Run Threads Daemon #

You need to run a threads daemon available to the client.

git clone git@github.com:textileio/go-threads.git
cd go-threads
go run threadsd/main.go -debug

Usage #

You can see complete usage examples in the provided test suite:

https://github.com/textileio/dart-threads-client/blob/master/test/threads_client.dart#L41

Development #

Install #

Run the daemon, as above. Next, install and run the Dart threads_client:

git clone git@github.com:textileio/dart-threads-client.git
cd dart-threads-client
pub get

Run tests #

dart test/threads_client_test.dart

Run example #

dart examples/helloworld.dart

Organization #

examples/helloworld.dart

This shows a simple use of the dart client.

lib/src/generated/

Contains all the protobufs generated by protoc. See updating instructions below.

lib/src/client.dart

This contains the client which wraps the gRPC API. Here, dart-native helper APIs could wrap each client endpoint to give the app a nice way to use the typed requests and responses.

Update protobufs #

dart-threads depends on protobufs built in go-threads. Until CI is setup, you can manually generate and update the protobufs in this project.

git clone git@github.com:textileio/go-threads.git
cd api/pb
make clean
make all
ls

The result should include,

api.pb.dart
api.pbenum.dart
api.pbgrpc.dart
api.pbjson.dart

Copy those files into, dart-threads-client/lib/src/generated/.

Contributing #

This project is a work in progress. As such, there's a few things you can do right now to help out:

  • Ask questions! We'll try to help. Be sure to drop a note (on the above issue) if there is anything you'd like to work on and we'll update the issue to let others know. Also get in touch on Slack.
  • Open issues, file issues, submit pull requests!
  • Perform code reviews. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
  • Take a look at the code. Contributions here that would be most helpful are top-level comments about how it should look based on your understanding. Again, the more eyes the better.
  • Add tests. There can never be enough tests.

Before you get started, be sure to read our contributors guide and our contributor covenant code of conduct.

Changelog #

Changelog is published to Releases.

License #

MIT

example/README.md

A single example is made available:

/helloworld.dart: A demonstration of using the Dart thread client to generate and start a new datastore. 

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  threads_client: ^0.1.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:threads_client/threads_client.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
34
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
63
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health issues and suggestions

Document public APIs. (-1 points)

90 out of 90 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/src/client.dart.

Run dartfmt to format lib/src/client.dart.

Format lib/src/defaults.dart.

Run dartfmt to format lib/src/defaults.dart.

Format lib/src/models.dart.

Run dartfmt to format lib/src/models.dart.

Format lib/threads_client.dart.

Run dartfmt to format lib/threads_client.dart.

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
async ^2.2.0 2.4.0
grpc ^2.1.3 2.1.3
protobuf ^1.0.1 1.0.1
threads_client_grpc ^0.1.4 0.1.5
uuid ^2.0.4 2.0.4
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.4
fixnum 0.10.11
googleapis_auth 0.2.11+1
http 0.12.0+4
http2 1.0.0
http_parser 3.1.3
meta 1.1.8
path 1.6.4
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.0.0 1.9.0
test ^1.6.4