Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinkSystemResolver ¶
type LinkSystemResolver interface {
ResolveLinkSystem(ctx context.Context, root cid.Cid, metadata []byte) (*ipld.LinkSystem, error)
}
LinkSystemResolves link systems from a root and associated metadata
type UnixFSAppResolver ¶
type UnixFSAppResolver struct {
// contains filtered or unexported fields
}
UnixFSAppResolver implements an AppResolver for the UnixFS domain
func NewUnixFSAppResolver ¶
func NewUnixFSAppResolver(store UnixFSStore, linkSystemResolver LinkSystemResolver) *UnixFSAppResolver
NewUnixFSAppResolver returns a new UnixFS resolver using the given UnixFSStore and LinkSystemResolver
func (*UnixFSAppResolver) GetResolver ¶
func (ufsar *UnixFSAppResolver) GetResolver(ctx context.Context, root cid.Cid) (*ipld.LinkSystem, stargate.PathResolver, error)
GetResolver attempts to resolve starting from the given root. It returns a linksystem to load blocks from and a resolver for the query
type UnixFSQueryResolver ¶
type UnixFSQueryResolver struct {
// contains filtered or unexported fields
}
UnixFSQueryResolver implements an QueryResolver for the UnixFS domain
func (*UnixFSQueryResolver) Done ¶
func (ufsqr *UnixFSQueryResolver) Done() bool
Done indicates if a UnixFS query resolution is complete. Since there is only one message for UnixFS query resolution, Done is true after a single call to Next
func (*UnixFSQueryResolver) Next ¶
func (ufsqr *UnixFSQueryResolver) Next() (*stargate.DAG, error)
Next fulfilles a UnixFS DAG query For files: the query parameter 'noleaves' will prevent leaves from being sent the query parameter 'bytes' will narrow results to a specifc range of bytes in the UnixFS file
type UnixFSResolver ¶
type UnixFSResolver struct {
// contains filtered or unexported fields
}
UnixFSResolver implements an PathResolver for the UnixFS domain
func (*UnixFSResolver) ResolvePathSegments ¶
func (ufsr *UnixFSResolver) ResolvePathSegments(ctx context.Context, path stargate.PathSegments) (*stargate.Path, stargate.PathSegments, stargate.PathResolver, error)
ResolvePathSegments attempts to resolve a UnixFS path On success, it resolves all paths and returns: - a stargate path message for the whole path - no unresolved segments - a path resolver operating at the end of the path On error, all values are be nil except the error value
func (*UnixFSResolver) ResolveQuery ¶
func (ufsr *UnixFSResolver) ResolveQuery(ctx context.Context, query stargate.Query) (stargate.QueryResolver, error)
ResolveQuery returns a resolver to fulfill the DAG part of a UnixFS query after path resolution with the given query string.
type UnixFSStore ¶
type UnixFSStore interface { DirLs(ctx context.Context, root cid.Cid, metadata []byte) ([][]unixfsstore.TraversedCID, error) DirPath(ctx context.Context, root cid.Cid, metadata []byte, path string) ([]cid.Cid, error) FileAll(ctx context.Context, root cid.Cid, metadata []byte) ([][]unixfsstore.TraversedCID, error) FileByteRange(ctx context.Context, root cid.Cid, metadata []byte, byteMin uint64, byteMax uint64) ([][]unixfsstore.TraversedCID, error) RootCID(ctx context.Context, root cid.Cid) ([]unixfsstore.RootCID, error) RootCIDWithMetadata(ctx context.Context, root cid.Cid, metadata []byte) (*unixfsstore.RootCID, error) }
UnixFSStore is an interface for fetching metadata about UnixFS queries