Documentation
¶
Overview ¶
Package protocol implements the bounded, strict JSON stream used by Orb Bridge.
Index ¶
- Constants
- func Canonical(b []byte) ([]byte, error)
- func Counter(s string) (uint64, error)
- func Decode(b []byte, v any) error
- func NewID() string
- func PageLimit(ctx context.Context) int
- func Read(r io.Reader) ([]byte, error)
- func ValidID(s string) bool
- func WithPageLimit(ctx context.Context, limit int) context.Context
- func Write(w io.Writer, b []byte) error
- type Conn
- type Handler
- type RPCError
Constants ¶
View Source
const ( Version = "orb-bridge/1" Service = "orb.instance/1" MaxFrame = 1 << 20 MaxRecord = 16 << 10 MaxDepth = 64 MaxPending = 64 MaxPage = 128 MaxOutput = 4 << 20 )
Variables ¶
This section is empty.
Functions ¶
func Canonical ¶
Canonical implements RFC 8785 for object payloads. Counters remain strings; numeric values use IEEE 754 binary64, as required by JCS.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) Invoke ¶
func (c *Conn) Invoke(ctx context.Context, method string, params json.RawMessage) (json.RawMessage, error)
func (*Conn) SetFrameLimit ¶
type Handler ¶
type Handler func(context.Context, string, json.RawMessage) (json.RawMessage, error)
Click to show internal directories.
Click to hide internal directories.