client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package client is a a simple muxrpc interface to common ssb methods, similar to npm:ssb-client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	muxrpc.Endpoint
	// contains filtered or unexported fields
}

func FromEndpoint

func FromEndpoint(edp muxrpc.Endpoint, opts ...Option) (*Client, error)

func NewTCP

func NewTCP(own ssb.KeyPair, remote net.Addr, opts ...Option) (*Client, error)

func NewUnix

func NewUnix(path string, opts ...Option) (*Client, error)

func (Client) BlobsGet

func (c Client) BlobsGet(ref refs.BlobRef) (io.Reader, error)

func (Client) BlobsHas

func (c Client) BlobsHas(ref refs.BlobRef) (bool, error)

func (Client) BlobsWant

func (c Client) BlobsWant(ref refs.BlobRef) error

func (Client) Close

func (c Client) Close() error

func (Client) CreateHistoryStream

func (c Client) CreateHistoryStream(o message.CreateHistArgs) (*muxrpc.ByteSource, error)

func (Client) CreateLogStream

func (c Client) CreateLogStream(o message.CreateLogArgs) (*muxrpc.ByteSource, error)

func (Client) MessagesByType

func (c Client) MessagesByType(o message.MessagesByTypeArgs) (*muxrpc.ByteSource, error)

func (Client) NamesGet

func (c Client) NamesGet() (NamesGetResult, error)

func (Client) NamesImageFor

func (c Client) NamesImageFor(ref refs.FeedRef) (refs.BlobRef, error)

func (Client) NamesSignifier

func (c Client) NamesSignifier(ref refs.FeedRef) (string, error)

func (Client) PrivatePublish

func (c Client) PrivatePublish(v interface{}, recps ...refs.FeedRef) (refs.MessageRef, error)

func (Client) PrivateRead

func (c Client) PrivateRead() (*muxrpc.ByteSource, error)

func (Client) Publish

func (c Client) Publish(v interface{}) (refs.MessageRef, error)

func (Client) ReplicateUpTo

func (c Client) ReplicateUpTo() (*muxrpc.ByteSource, error)

func (Client) TanglesThread added in v0.2.1

func (c Client) TanglesThread(o message.TanglesArgs) (*muxrpc.ByteSource, error)

func (Client) Whoami

func (c Client) Whoami() (refs.FeedRef, error)

type NamesGetResult

type NamesGetResult map[string]map[string]string

func (NamesGetResult) GetCommonName

func (ngr NamesGetResult) GetCommonName(feed refs.FeedRef) (string, bool)

type Option

type Option func(*Client) error

func WithContext

func WithContext(ctx context.Context) Option

func WithLogger

func WithLogger(l log.Logger) Option

func WithSHSAppKey

func WithSHSAppKey(appKey string) Option

Jump to

Keyboard shortcuts

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