shrexnd

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

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 implements client side of shrex/nd protocol to obtain namespaced shares data from remote peers.

func NewClient

func NewClient(host host.Host, opts ...Option) (*Client, error)

NewClient creates a new shrEx/nd client

func (*Client) GetSharesByNamespace

func (c *Client) GetSharesByNamespace(
	ctx context.Context,
	root *share.Root,
	nID namespace.ID,
	peerIDs ...peer.ID,
) (share.NamespacedShares, error)

GetSharesByNamespace request shares with option to collect proofs from remote peers using shrex protocol

type Option

type Option func(*Parameters)

Option is the functional option that is applied to the shrex/eds protocol to configure its parameters.

func WithProtocolSuffix

func WithProtocolSuffix(protocolSuffix string) Option

WithProtocolSuffix is a functional option that configures the `protocolSuffix` parameter

func WithReadTimeout

func WithReadTimeout(readTimeout time.Duration) Option

WithReadTimeout is a functional option that configures the `readTimeout` parameter

func WithServeTimeout

func WithServeTimeout(serveTimeout time.Duration) Option

WithServeTimeout is a functional option that configures the `serveTimeout` parameter

func WithWriteTimeout

func WithWriteTimeout(writeTimeout time.Duration) Option

WithWriteTimeout is a functional option that configures the `writeTimeout` parameter

type Parameters

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

Parameters is the set of parameters that must be configured for the shrex/eds protocol.

func DefaultParameters

func DefaultParameters() *Parameters

func (*Parameters) Validate

func (p *Parameters) Validate() error

type Server

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

Server implements server side of shrex/nd protocol to serve namespaced share to remote peers.

func NewServer

func NewServer(host host.Host, store *eds.Store, getter *getters.IPLDGetter, opts ...Option) (*Server, error)

NewServer creates new Server

func (*Server) Start

func (srv *Server) Start()

Start starts the server

func (*Server) Stop

func (srv *Server) Stop()

Stop stops the server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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