client

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 19 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides the client api.

func NewClient

func NewClient(target string, opts ...grpc.DialOption) (*Client, error)

NewClient starts the client.

func (*Client) AddRecord

func (c *Client) AddRecord(ctx context.Context, id thread.ID, lid peer.ID, rec core.Record) error

func (*Client) AddReplicator

func (c *Client) AddReplicator(ctx context.Context, id thread.ID, paddr ma.Multiaddr) (peer.ID, error)

func (*Client) AddThread

func (c *Client) AddThread(ctx context.Context, addr ma.Multiaddr, opts ...core.KeyOption) (info thread.Info, err error)

func (*Client) Close

func (c *Client) Close() error

Close closes the client's grpc connection and cancels any active requests.

func (*Client) CreateRecord

func (c *Client) CreateRecord(ctx context.Context, id thread.ID, body format.Node) (core.ThreadRecord, error)

func (*Client) CreateThread

func (c *Client) CreateThread(ctx context.Context, id thread.ID, opts ...core.KeyOption) (info thread.Info, err error)

func (*Client) DeleteThread

func (c *Client) DeleteThread(ctx context.Context, id thread.ID) error

func (*Client) GetHostID

func (c *Client) GetHostID(ctx context.Context) (peer.ID, error)

GetHostID returns the service's host peer ID.

func (*Client) GetRecord

func (c *Client) GetRecord(ctx context.Context, id thread.ID, rid cid.Cid) (core.Record, error)

func (*Client) GetThread

func (c *Client) GetThread(ctx context.Context, id thread.ID) (info thread.Info, err error)

func (*Client) PullThread

func (c *Client) PullThread(ctx context.Context, id thread.ID) error

func (*Client) Subscribe

func (c *Client) Subscribe(ctx context.Context, opts ...core.SubOption) (<-chan core.ThreadRecord, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL