Documentation
¶
Index ¶
- type Client
- func (c *Client) Get(ID common.MessageID, signature []byte) ([]byte, error)
- func (c *Client) GetStorageProvider(ID common.MessageID) (StorageLocation, error)
- func (c *Client) GetWithContext(ctx context.Context, ID common.MessageID, signature []byte) ([]byte, error)
- func (c *Client) PayloadSize() int
- func (c *Client) Put(ID common.MessageID, signature, payload []byte) error
- func (c *Client) PutWithContext(ctx context.Context, ID common.MessageID, signature, payload []byte) error
- type DeterministicDescriptorList
- type ReadOnlyClient
- type ReadWriteClient
- type StorageLocation
- type WriteOnlyClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) GetStorageProvider ¶
func (c *Client) GetStorageProvider(ID common.MessageID) (StorageLocation, error)
GetStorageProvider returns the deterministically selected storage provider given a storage secret ID
func (*Client) GetWithContext ¶
func (c *Client) GetWithContext(ctx context.Context, ID common.MessageID, signature []byte) ([]byte, error)
GetWithContext requests ID from the chosen storage node and blocks until a response is received or is cancelled.
func (*Client) PayloadSize ¶
PayloadSize returns the size of the user payload
type DeterministicDescriptorList ¶
type DeterministicDescriptorList []utils.ServiceDescriptor
func (DeterministicDescriptorList) Len ¶
func (d DeterministicDescriptorList) Len() int
func (DeterministicDescriptorList) Less ¶
func (d DeterministicDescriptorList) Less(i, j int) bool
func (DeterministicDescriptorList) Swap ¶
func (d DeterministicDescriptorList) Swap(i, j int)
type ReadOnlyClient ¶
type ReadOnlyClient interface {
Get(addr []byte) ([]byte, error)
GetWithContext(ctx context.Context, addr []byte) ([]byte, error)
PayloadSize() int
}
ReadOnlyClient only has Get
func ReadOnly ¶
func ReadOnly(c *Client, roCap common.ReadOnlyCap) ReadOnlyClient
ReadOnly returns a Transport using map that can read with Get() only
type ReadWriteClient ¶
type ReadWriteClient interface {
Put(addr []byte, payload []byte) error
Get(addr []byte) ([]byte, error)
PutWithContext(ctx context.Context, addr []byte, payload []byte) error
GetWithContext(ctx context.Context, addr []byte) ([]byte, error)
PayloadSize() int
}
ReadWriteClient has both Get and Put
func Duplex ¶
func Duplex(c *Client, r common.ReadOnlyCap, w common.WriteOnlyCap) ReadWriteClient
Duplex returns a RWclient from a pair of ReadOnly and WriteOnly capabilities
func DuplexFromSeed ¶
func DuplexFromSeed(c *Client, initiator bool, secret []byte) ReadWriteClient
func ReadWrite ¶
func ReadWrite(c *Client, rwCap common.ReadWriteCap) ReadWriteClient
ReadWrite returns a Transport using map that can read or write with Get() and Put()
type StorageLocation ¶
type WriteOnlyClient ¶
type WriteOnlyClient interface {
Put(addr []byte, payload []byte) error
PutWithContext(ctx context.Context, addr []byte, payload []byte) error
PayloadSize() int
}
WriteOnlyClient only has Put
func WriteOnly ¶
func WriteOnly(c *Client, woCap common.WriteOnlyCap) WriteOnlyClient
WriteOnly returns a Transport using map that can write with Put() only