Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type OpsHandler ¶
type OpsHandlerFunc ¶
type OpsHandlerFunc func(ctx context.Context, opName string, in []byte, out []byte) (Payload, error)
OpsHandlerFunc adapts a plain function to the OpsHandler interface, in the same shape as http.HandlerFunc. Built-in core ops (e.g. txco://noop) are registered as OpsHandlerFunc values.
type Payload ¶
type Payload struct {
Raw string `json:"raw,omitempty"`
Type Type `json:"type,omitempty"`
Meta string `json:"meta,omitempty"`
}
func CreateJSONPayload ¶
type Type ¶
type Type int
Event payloads may have different types
const ( // Null is an empty message, an ACK Null Type = iota // JSON is a raw block of JSON JSON // Error ErrorStr // StreamHead carries the response status + headers snapshot for a // streamed HTTP response. Sent once, before any StreamChunk; the // outlet writes the head and switches into incremental-flush mode. StreamHead // StreamChunk carries a block of raw (already-decoded) response body // bytes in Raw, to be written and flushed immediately. StreamChunk // StreamEnd terminates a streamed response. No body; the outlet // returns once it receives this. StreamEnd )
Click to show internal directories.
Click to hide internal directories.