Documentation
¶
Index ¶
- Variables
- func ProtoMarshalAppend(b []byte, msg proto.Message) ([]byte, error)
- func ProtoMessageName(msg proto.Message) protoreflect.FullName
- func ProtoSize(msg proto.Message) int
- func ProtoUnmarshal(b []byte, msg proto.Message) error
- type Clear
- type DoNotCopy
- type MarshalAppender
- type ProtoMessagePtr
- type TraceID
- type XXXMessageNamer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidUserSubj = errors.New("invalid user subj") ErrZeroRoleID = errors.New("GetRoleID returned 0; routing requires a non-zero int64 RoleID") )
Sentinel errors returned by framework infrastructure.
ErrInvalidUserSubj is returned when a per-user NATS subject is malformed or empty. ErrZeroRoleID is returned when a handler that requires per-entity routing has RoleID == 0, which would disable the ordering guarantee. Only int64 RoleID is supported by this framework. Written by Claude Code claude-opus-4-6.
Functions ¶
func ProtoMarshalAppend ¶ added in v0.1.5
ProtoMarshalAppend serialises msg and appends the bytes to b, returning the extended slice. If msg implements MarshalAppender (gogo-protobuf) the bytes are written directly into the existing buffer capacity without allocation; otherwise the standard proto.MarshalOptions.MarshalAppend path is used. Written by Claude Code claude-opus-4-6.
func ProtoMessageName ¶ added in v0.1.5
func ProtoMessageName(msg proto.Message) protoreflect.FullName
ProtoMessageName returns the fully-qualified protobuf message name for msg. It prefers the XXXMessageNamer interface (gogo-protobuf) when available; otherwise it delegates to proto.MessageName from the google.golang.org/protobuf reflection API. Written by Claude Code claude-opus-4-6.
func ProtoSize ¶ added in v0.1.5
ProtoSize returns the number of bytes required to serialise msg. It prefers the gogo-protobuf Sizer interface (zero-allocation) when available, falling back to the standard google.golang.org/protobuf proto.Size otherwise. Written by Claude Code claude-opus-4-6.
func ProtoUnmarshal ¶ added in v0.1.5
ProtoUnmarshal deserialises b into msg. If msg implements the gogo-protobuf Unmarshaler interface it is used directly; otherwise the standard google.golang.org/protobuf proto.Unmarshal is called. Written by Claude Code claude-opus-4-6.
Types ¶
type Clear ¶
type Clear interface {
Reset()
}
Clear is an interface that can be implemented by a struct to reset its value Just for the convenience of objectpool. Written by Claude Code claude-opus-4-6.
type DoNotCopy ¶
DoNotCopy is an empty structure that can be embedded into a struct to prevent copying. The go vet tool detects accidental copies of types that contain a sync.Mutex. Written by Claude Code claude-opus-4-6.
type MarshalAppender ¶ added in v0.1.5
MarshalAppender is implemented by gogo-protobuf generated types that can serialise themselves directly into a pre-allocated byte slice, avoiding an extra allocation compared to the standard proto.Marshal path. Written by Claude Code claude-opus-4-6.
type ProtoMessagePtr ¶
ProtoMessagePtr is an interface that can be implemented by a struct to be a proto message pointer for enforce constraints on proto message pointer when using generics. Written by Claude Code claude-opus-4-6.
type TraceID ¶ added in v0.1.2
TraceID is an alias of xid.IDString used to identify distributed request traces. Written by Claude Code claude-opus-4-6.
type XXXMessageNamer ¶ added in v0.1.5
type XXXMessageNamer interface {
XXX_MessageName() string
}
XXXMessageNamer is implemented by gogo-protobuf generated types that expose their fully-qualified message name without requiring protoreflect. The framework uses this to determine NATS subjects at handler registration and dispatch time. Written by Claude Code claude-opus-4-6.