Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BindnodeRegistry = bindnoderegistry.NewRegistry()
Functions ¶
This section is empty.
Types ¶
type AppResolver ¶
type AppResolver interface {
// GetResolver attempts to resolve starting from the given root. It returns a linksystem to load blocks from
// and a resolver for the query
GetResolver(ctx context.Context, root cid.Cid) (*ipld.LinkSystem, PathResolver, error)
}
AppResolver finds the root of a dag and returns an associated blockstore to use serving the request
type BlockMetadata ¶
type BlockMetadata []BlockMetadatum
BlockMetadata is metadata for each "link" in the DAG being communicated, each block gets one of these and missing blocks also get one
type BlockMetadatum ¶
type BlockMetadatum struct {
Link cid.Cid
Status BlockStatus
}
BlockMetadatum is metadata for a single block
type BlockStatus ¶
type BlockStatus string
BlockStatus indicates information about what is being done with a given block in a request
const ( // BlockStatusPresent means the linked block was present on this machine, and is included // in this message BlockStatusPresent BlockStatus = "Present" // BlockStatusNotSent means the linked block was present on this machine, but not sent // - it needs to be fetched elsewhere BlockStatusNotSent BlockStatus = "NotSent" // BlockStatusMissing means I did not have the linked block, so I skipped over this part // of the traversal BlockStatusMissing BlockStatus = "Missing" // BlockStatusDuplicate means the linked block was encountered, but we already have traversed it // so we're not traversing it again -- the block has likely already been transmitted BlockStatusDuplicate BlockStatus = "Duplicate" )
type DAG ¶
type DAG struct {
Ordering Ordering
Blocks BlockMetadata
}
Path is a StarGate message that provides information about resolution of the DAG at the end of a query
type ErrNoMoreMessages ¶
type ErrNoMoreMessages struct{}
func (ErrNoMoreMessages) Error ¶
func (e ErrNoMoreMessages) Error() string
type ErrNotFound ¶
func (ErrNotFound) Error ¶
func (e ErrNotFound) Error() string
type ErrPathError ¶
func (ErrPathError) Error ¶
func (e ErrPathError) Error() string
func (ErrPathError) Unwrap ¶
func (e ErrPathError) Unwrap() error
type Kind ¶
type Kind string
Kind indicates whether a generic StarGate message is for a Path or a DAG
type Path ¶
type Path struct {
// name of this path segment
Segments []string
// CIDs required, in order, to verify this segment of the path
Blocks BlockMetadata
}
Path is a StarGate message that provides information about resolution of a path
type PathResolver ¶
type PathResolver interface {
// ResolvePathSegments attempts to resolve a path
// On success, an implementation should:
// - resolve at least one path segment
// - return:
// - a valid stargate path message
// - any unresolved segments
// - a resolver operating whose root is at the end of the resolved portion of the path
// On error, all values should be nil except the error value
ResolvePathSegments(ctx context.Context, path PathSegments) (*Path, PathSegments, PathResolver, error)
// ResolverQuery returns a resolver to fulfill the remaining portion of a request after path resolution with the
// given query string.
ResolveQuery(ctx context.Context, query Query) (QueryResolver, error)
}
PathResolver resolves the URL path
type QueryResolver ¶
type QueryResolver interface {
// Next returns the next message
Next() (*DAG, error)
// done indicates where the query is fully resolved or there are more messages
Done() bool
}
QueryResolver produces one or more stargate DAG messages to fulfill the request at the end of the path
type StarGateMessage ¶
StarGateMessage is a complete StarGate message ahead of a block sequence
Directories
¶
| Path | Synopsis |
|---|---|
|
Package blockwriter is not currently used, but it's useful code we may need
|
Package blockwriter is not currently used, but it's useful code we may need |
|
Package handler implements the HTTP mechanics of sending StarGate responses
|
Package handler implements the HTTP mechanics of sending StarGate responses |