define

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func ProtoMarshalAppend(b []byte, msg proto.Message) ([]byte, error)

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

func ProtoSize(msg proto.Message) int

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

func ProtoUnmarshal(b []byte, msg proto.Message) error

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

type DoNotCopy [0]sync.Mutex

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

type MarshalAppender interface {
	MarshalTo(data []byte) (n int, err error)
}

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

type ProtoMessagePtr[T any] interface {
	proto.Message
	*T
}

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

type TraceID = xid.IDString

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL