Versions in this module Expand all Collapse all v0 v0.2.1 Oct 9, 2026 v0.2.0 Oct 8, 2026 Changes in this version + const CodeInvalid + const CodeInvalidType + const CodeMalformed + var ErrAckWithoutID = errors.New("celerity: a binary message asking to be acknowledged needs an id") + var ErrMessageIDTooLong = errors.New("celerity: a binary message id must be at most 255 bytes") + var ErrRouteRequired = errors.New("celerity: a binary message must name the route it is for") + var ErrRouteReserved = errors.New("celerity: a binary message route must not begin with a reserved byte") + var ErrRouteTooLong = errors.New("celerity: a binary message route must be at most 255 bytes") + func CatchAllParam(route string) (string, bool) + func FrameBinaryMessage(route, messageID string, requireAck bool, message []byte) ([]byte, error) + func NormaliseRoute(route string) string + type Ack struct + Error string + Success bool + type BatchResult struct + Failures []RecordFailure + func (r *BatchResult) Fail(messageID string, err error) + func (r *BatchResult) Failed() bool + type BinarySender interface + SendBinary func(ctx context.Context, messages ...OutboundBinaryMessage) error + type ConsumerBatch struct + Records []ConsumerRecord + SourceID string + SourceType string + Vendor []byte + type ConsumerRecord struct + Attributes []byte + Body []byte + EventType string + MessageID string + Source string + Vendor []byte + type CustomInvoke struct + HandlerName string + Input []byte + type CustomInvokeResult struct + Output []byte + type DetailCarrier interface + Details func() any + type Error struct + Message string + Stack string + Type string + func (e *Error) Error() string + type Event struct + Consumer *ConsumerBatch + Custom *CustomInvoke + Deadline time.Time + HTTP *Request + ID string + Kind Kind + Schedule *ScheduleTrigger + Tag string + Timestamp time.Time + TraceContext map[string]string + WebSocket *WebSocketMessage + type Func func(ctx context.Context, ev *Event) (*Result, error) + type IssueReporter interface + ValidationIssues func() []ValidationIssue + type Kind string + const KindConsumer + const KindCustom + const KindHTTP + const KindSchedule + const KindWebSocket + type OutboundBinaryMessage struct + Caller string + ConnectionID string + FrameMessageID string + InformClientsOnLoss []string + Message []byte + MessageID string + RequireAck bool + Route string + WaitForAck bool + type OutboundMessage struct + Caller string + ConnectionID string + InformClientsOnLoss []string + Message []byte + MessageID string + WaitForAck bool + type Params map[string]Values + func (p Params) Add(name, value string) + func (p Params) Get(name string) string + func (p Params) Set(name, value string) + type RecordFailure struct + Error string + MessageID string + type Request struct + Body []byte + Headers Params + Method string + Path string + PathParams Params + QueryParams Params + RequestID string + Route string + SourceIP string + type Response struct + Body []byte + Headers Params + Status int + func JSONAnswer(status int, message string, detail any) *Response + func JSONMessage(status int, message string) *Response + func ResponseForError(err error) (*Response, bool) + type Result struct + Consumer *BatchResult + Custom *CustomInvokeResult + Error *Error + HTTP *Response + ID string + Schedule *Ack + WebSocket *Ack + type ScheduleTrigger struct + Input []byte + MessageID string + Schedule string + ScheduleID string + Vendor []byte + type SendError struct + Failures []SendFailure + func (e *SendError) Error() string + func (e *SendError) Failed(index int) bool + type SendFailure struct + ConnectionID string + Error string + Index int + type StatusCoder interface + StatusCode func() int + type StatusError struct + Detail any + Err error + Message string + Status int + func BadRequest(message string) *StatusError + func Conflict(message string) *StatusError + func Forbidden(message string) *StatusError + func Gone(message string) *StatusError + func NotFound(message string) *StatusError + func NotImplemented(message string) *StatusError + func ServiceUnavailable(message string) *StatusError + func Status(status int, message string) *StatusError + func Statusf(status int, format string, args ...any) *StatusError + func TooManyRequests(message string) *StatusError + func Unauthorized(message string) *StatusError + func UnprocessableEntity(message string) *StatusError + func Wrap(status int, message string, cause error) *StatusError + func (e *StatusError) Details() any + func (e *StatusError) Error() string + func (e *StatusError) ErrorType() string + func (e *StatusError) StatusCode() int + func (e *StatusError) Unwrap() error + func (e *StatusError) WithDetail(detail any) *StatusError + type TypedError interface + ErrorType func() string + type ValidationError struct + Err error + Issues []ValidationIssue + Message string + func Invalid(message string, issues ...ValidationIssue) *ValidationError + func (e *ValidationError) Details() any + func (e *ValidationError) Error() string + func (e *ValidationError) ErrorType() string + func (e *ValidationError) StatusCode() int + func (e *ValidationError) Unwrap() error + func (e *ValidationError) ValidationIssues() []ValidationIssue + type ValidationIssue struct + Code string + Message string + Path []string + func Issue(code, message string, path ...string) ValidationIssue + func IssuesFrom(err error) []ValidationIssue + func IssuesFromDecode(err error) []ValidationIssue + type Values []string + func (v Values) First() string + type WebSocketMessage struct + ConnectionID string + IsBinary bool + Message []byte + MessageID string + RequestID string + Route string + SourceIP string + type WebSocketSender interface + Send func(ctx context.Context, messages ...OutboundMessage) error