Documentation ¶
Index ¶
- func IsTerminalFailureCode(status graphsync.ResponseStatusCode) bool
- func IsTerminalResponseCode(status graphsync.ResponseStatusCode) bool
- func IsTerminalSuccessCode(status graphsync.ResponseStatusCode) bool
- type Exportable
- type GraphSyncMessage
- type GraphSyncRequest
- func (gsr GraphSyncRequest) Extension(name graphsync.ExtensionName) ([]byte, bool)
- func (gsr GraphSyncRequest) ID() graphsync.RequestID
- func (gsr GraphSyncRequest) IsCancel() bool
- func (gsr GraphSyncRequest) IsUpdate() bool
- func (gsr GraphSyncRequest) MergeExtensions(extensions []graphsync.ExtensionData, ...) (GraphSyncRequest, error)
- func (gsr GraphSyncRequest) Priority() graphsync.Priority
- func (gsr GraphSyncRequest) ReplaceExtensions(extensions []graphsync.ExtensionData) GraphSyncRequest
- func (gsr GraphSyncRequest) Root() cid.Cid
- func (gsr GraphSyncRequest) Selector() ipld.Node
- type GraphSyncResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminalFailureCode ¶
func IsTerminalFailureCode(status graphsync.ResponseStatusCode) bool
IsTerminalFailureCode returns true if the response code indicates the request terminated in failure.
func IsTerminalResponseCode ¶
func IsTerminalResponseCode(status graphsync.ResponseStatusCode) bool
IsTerminalResponseCode returns true if the response code signals the end of the request
func IsTerminalSuccessCode ¶
func IsTerminalSuccessCode(status graphsync.ResponseStatusCode) bool
IsTerminalSuccessCode returns true if the response code indicates the request terminated successfully.
Types ¶
type Exportable ¶
Exportable is an interface that can serialize to a protobuf
type GraphSyncMessage ¶
type GraphSyncMessage interface { Requests() []GraphSyncRequest Responses() []GraphSyncResponse Blocks() []blocks.Block AddRequest(graphSyncRequest GraphSyncRequest) AddResponse(graphSyncResponse GraphSyncResponse) AddBlock(blocks.Block) Empty() bool Exportable Loggable() map[string]interface{} }
GraphSyncMessage is interface that can be serialized and deserialized to send over the GraphSync network
func FromNet ¶
func FromNet(r io.Reader) (GraphSyncMessage, error)
FromNet can read a network stream to deserialized a GraphSyncMessage
func FromPBReader ¶
func FromPBReader(pbr ggio.Reader) (GraphSyncMessage, error)
FromPBReader can deserialize a protobuf message into a GraphySyncMessage.
type GraphSyncRequest ¶
type GraphSyncRequest struct {
// contains filtered or unexported fields
}
GraphSyncRequest is a struct to capture data on a request contained in a GraphSyncMessage.
func CancelRequest ¶
func CancelRequest(id graphsync.RequestID) GraphSyncRequest
CancelRequest request generates a request to cancel an in progress request
func NewRequest ¶
func NewRequest(id graphsync.RequestID, root cid.Cid, selector ipld.Node, priority graphsync.Priority, extensions ...graphsync.ExtensionData) GraphSyncRequest
NewRequest builds a new Graphsync request
func UpdateRequest ¶ added in v0.1.0
func UpdateRequest(id graphsync.RequestID, extensions ...graphsync.ExtensionData) GraphSyncRequest
UpdateRequest generates a new request to update an in progress request with the given extensions
func (GraphSyncRequest) Extension ¶ added in v0.0.4
func (gsr GraphSyncRequest) Extension(name graphsync.ExtensionName) ([]byte, bool)
Extension returns the content for an extension on a response, or errors if extension is not present
func (GraphSyncRequest) ID ¶
func (gsr GraphSyncRequest) ID() graphsync.RequestID
ID Returns the request ID for this Request
func (GraphSyncRequest) IsCancel ¶
func (gsr GraphSyncRequest) IsCancel() bool
IsCancel returns true if this particular request is being cancelled
func (GraphSyncRequest) IsUpdate ¶ added in v0.1.0
func (gsr GraphSyncRequest) IsUpdate() bool
IsUpdate returns true if this particular request is being updated
func (GraphSyncRequest) MergeExtensions ¶ added in v0.1.0
func (gsr GraphSyncRequest) MergeExtensions(extensions []graphsync.ExtensionData, mergeFunc func(name graphsync.ExtensionName, oldData []byte, newData []byte) ([]byte, error)) (GraphSyncRequest, error)
MergeExtensions merges the given list of extensions to produce a new request with the combination of the old request plus the new extensions. When an old extension and a new extension are both present, mergeFunc is called to produce the result
func (GraphSyncRequest) Priority ¶
func (gsr GraphSyncRequest) Priority() graphsync.Priority
Priority returns the priority of this request
func (GraphSyncRequest) ReplaceExtensions ¶ added in v0.1.0
func (gsr GraphSyncRequest) ReplaceExtensions(extensions []graphsync.ExtensionData) GraphSyncRequest
ReplaceExtensions merges the extensions given extensions into the request to create a new request, but always uses new data
func (GraphSyncRequest) Root ¶
func (gsr GraphSyncRequest) Root() cid.Cid
Root returns the CID to the root block of this request
func (GraphSyncRequest) Selector ¶
func (gsr GraphSyncRequest) Selector() ipld.Node
Selector returns the byte representation of the selector for this request
type GraphSyncResponse ¶
type GraphSyncResponse struct {
// contains filtered or unexported fields
}
GraphSyncResponse is an struct to capture data on a response sent back in a GraphSyncMessage.
func NewResponse ¶
func NewResponse(requestID graphsync.RequestID, status graphsync.ResponseStatusCode, extensions ...graphsync.ExtensionData) GraphSyncResponse
NewResponse builds a new Graphsync response
func (GraphSyncResponse) Extension ¶ added in v0.0.4
func (gsr GraphSyncResponse) Extension(name graphsync.ExtensionName) ([]byte, bool)
Extension returns the content for an extension on a response, or errors if extension is not present
func (GraphSyncResponse) RequestID ¶
func (gsr GraphSyncResponse) RequestID() graphsync.RequestID
RequestID returns the request ID for this response
func (GraphSyncResponse) Status ¶
func (gsr GraphSyncResponse) Status() graphsync.ResponseStatusCode
Status returns the status for a response