Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*config) error
An Option allows opening a Session with configured options.
func WithDS ¶
func WithDS(ds datastore.Batching) Option
WithDS sets the datastore to use for the session
func WithDataTransfer ¶
func WithDataTransfer(dt datatransferi.Manager) Option
WithDataTransfer runs the session using an existing data transfer manager.
func WithIndexer ¶
WithIndexer sets a URL of the indexer to use.
type ProgressResult ¶
A ProgressResult is an individual update from a call to `GetStream` The result will either have a status of `Error` and an Error set, or will have a node and path set. The ResultChan a result is sent down will close after an error result or 'complete' result is sent.
type ResultChan ¶
type ResultChan chan ProgressResult
ResultChan provides progress updates from a call to `GetStream`
type Session ¶
type Session interface { // Get returns a dag rooted at root. If selector is `nil`, the single block // of the root will be assumed. If the full dag under root is desired, (following links) // `CommonSelector_MatchAllRecursively` should be provided. Get(ctx context.Context, root cid.Cid, selector datamodel.Node) (ipld.Node, error) // TODO: GetStream is not yet implemented - should follow logic of get but with incremental responses. //GetStream(ctx context.Context, root cid.Cid, selector datamodel.Node) ResultChan Close() error }
A Session is able to fetch content addressed data.
func NewSession ¶
NewSession creates a Session with given configuration. A session represents a set of related queries for content addressed data. Connections to peers may stay open for the life of a session.