Skip to content

textileio/dart-threads-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dart-threads-client

Made by Textile Chat on Slack GitHub license CircleCI branch Pub

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 [email protected]: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 [email protected]: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 [email protected]: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