Documentation
¶
Index ¶
- Constants
- func Read(stream io.Reader, value any, compressed bool) error
- func ReadLimited(stream io.Reader, value any, maximum int) error
- func Write(stream io.Writer, value any, compressed bool) error
- func WriteReply(reply Reply, write func(Reply) error) error
- type Assembly
- type Call
- type CallKind
- type Delivery
- type Endpoint
- type Envelope
- type Reader
- type Reply
- type ReplyKind
- type Response
- type SnapshotHeader
- type SnapshotPage
Constants ¶
View Source
const MaxSnapshotBytes = 16 * protocol.MAX_FRAME_BYTES
MaxSnapshotBytes bounds what a receiver buffers for one paged snapshot or directory: 256 pages, twice the protocol's largest single payload (MAX_CHANGE_BYTES).
View Source
const NodeALPN = "sailry/node/1"
View Source
const PageBytes = protocol.MAX_FRAME_BYTES / 16
View Source
const PairALPN = "sailry/pair/1"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Call ¶
type Call struct {
Kind CallKind
Stream *protocol.StreamID
Request *protocol.Request
Topic *protocol.Topic
Resource *protocol.ResourceCall
ScopedKnowledge *protocol.ScopedKnowledgeCall
}
func (Call) MarshalJSON ¶
func (*Call) UnmarshalJSON ¶
type Endpoint ¶
type Endpoint struct {
SoftwareVersion *string `json:"software_version"`
Protocol *uint16 `json:"protocol"`
Zstd bool `json:"zstd"`
Execution bool `json:"execution"`
Name *string `json:"name"`
Platform string `json:"platform"`
HasNode *bool `json:"has_node,omitempty"`
}
func (*Endpoint) UnmarshalJSON ¶
type Envelope ¶
type Envelope struct {
SoftwareVersion *string
Protocol *uint16
Zstd bool
Call Call
HasNode *bool
Target *protocol.NodeID
// RawData preserves a relayed business payload, including peer fields this
// build does not know. Only transport metadata is rewritten at the next hop.
RawData json.RawMessage
// Undecoded is set by decoding alone: the identifier of a command request
// whose version, identifier and target decoded and whose command did not,
// because this build does not declare its kind or cannot read its
// payload. Call is then a command without a Request. The receiver can
// answer such a request on its stream; it cannot run it.
Undecoded *protocol.RequestID
}
func (Envelope) MarshalJSON ¶
func (*Envelope) UnmarshalJSON ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
type Reply ¶
type Reply struct {
Kind ReplyKind
Endpoint *Endpoint
Receipt *protocol.Receipt
Rejected *protocol.Fault
Completed *Response
Update *protocol.Update
SnapshotStart *SnapshotHeader
SnapshotPage *SnapshotPage
}
func (Reply) MarshalJSON ¶
func (*Reply) UnmarshalJSON ¶
type ReplyKind ¶
type ReplyKind string
const ( ReplyEndpoint ReplyKind = "endpoint" ReplyStreamOpened ReplyKind = "stream_opened" ReplySubscribed ReplyKind = "subscribed" ReplyReceipt ReplyKind = "receipt" ReplyRejected ReplyKind = "rejected" ReplyCompleted ReplyKind = "completed" ReplyUpdate ReplyKind = "update" ReplySnapshotStart ReplyKind = "snapshot_start" ReplySnapshotPage ReplyKind = "snapshot_page" )
type SnapshotHeader ¶
type SnapshotHeader struct {
Delivery Delivery `json:"delivery"`
Node protocol.NodeID `json:"node"`
Cursor uint64 `json:"cursor"`
Bytes uint64 `json:"bytes"`
Output string `json:"output,omitempty"`
}
func (*SnapshotHeader) UnmarshalJSON ¶
func (header *SnapshotHeader) UnmarshalJSON(data []byte) error
type SnapshotPage ¶
func (*SnapshotPage) UnmarshalJSON ¶
func (page *SnapshotPage) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.