Documentation
¶
Index ¶
- Constants
- Variables
- type Acknowledgement
- type ConfirmInput
- type ConfirmOutput
- type Envelope
- type InboxInput
- type InboxOutput
- type Message
- type Options
- type ReceiveInput
- type ReceiveOutput
- type SendInput
- type SendOutput
- type Service
- func (s *Service) Checkpoint() (identity.Checkpoint, error)
- func (s *Service) Confirm(ctx context.Context, input ConfirmInput) (ConfirmOutput, error)
- func (s *Service) Inbox(_ context.Context, input InboxInput) (InboxOutput, error)
- func (s *Service) Receive(ctx context.Context, input ReceiveInput) (ReceiveOutput, error)
- func (s *Service) Send(ctx context.Context, input SendInput) (SendOutput, error)
- func (s *Service) Shutdown(ctx context.Context) error
Constants ¶
View Source
const ( // MaxMessageBytes is the protocol-wide decoded text ceiling. MaxMessageBytes = 1 << 20 // MaxInboxOutputBytes bounds the encoded structured result of list_messages. // It admits one maximally escaped protocol message plus fixed metadata. MaxInboxOutputBytes = 6*MaxMessageBytes + 64*1024 // MaxMCPOutputBytes adds fixed JSON-RPC and MCP result framing headroom. MaxMCPOutputBytes = MaxInboxOutputBytes + 64*1024 )
Variables ¶
View Source
var ( ErrInvalidInput = errors.New("invalid channel input") ErrConflict = errors.New("identifier conflicts with an existing message") ErrBusy = errors.New("channel is at its concurrency limit") ErrRateLimited = errors.New("channel request budget exhausted") ErrClosed = errors.New("channel service is shutting down") )
Functions ¶
This section is empty.
Types ¶
type Acknowledgement ¶
type Acknowledgement struct {
Version int `json:"version"`
MessageID string `json:"message_id"`
Source string `json:"source"`
Destination string `json:"destination"`
EnvelopeSHA256 string `json:"envelope_sha256"`
ReceivedAt string `json:"received_at"`
ReceiverAuditSequence uint64 `json:"receiver_audit_sequence"`
ReceiverAuditHead string `json:"receiver_audit_head"`
Signature string `json:"signature"`
}
type ConfirmInput ¶
type ConfirmInput struct {
Acknowledgement Acknowledgement `json:"acknowledgement"`
}
type ConfirmOutput ¶
type Envelope ¶
type Envelope struct {
Version int `json:"version"`
MessageID string `json:"message_id"`
RequestID string `json:"request_id"`
ConversationID string `json:"conversation_id"`
Source string `json:"source"`
Destination string `json:"destination"`
CreatedAt string `json:"created_at"`
Body string `json:"body"`
BodySHA256 string `json:"body_sha256"`
PolicyVersion string `json:"policy_version"`
GuardModel string `json:"guard_model"`
GuardDecision string `json:"guard_decision"`
SourceAuditSequence uint64 `json:"source_audit_sequence"`
SourceAuditHead string `json:"source_audit_head"`
Signature string `json:"signature"`
}
type InboxInput ¶
type InboxOutput ¶
type Message ¶
type Message struct {
MessageID string `json:"message_id"`
ConversationID string `json:"conversation_id"`
Source string `json:"source"`
Destination string `json:"destination"`
Body string `json:"body"`
BodySHA256 string `json:"body_sha256"`
ReceivedAt string `json:"received_at"`
AuditSequence uint64 `json:"audit_sequence"`
}
type Options ¶
type Options struct {
Audit *audit.Log
Signer *identity.Signer
Peers map[string]string
Guard guard.Evaluator
Approvals *approval.Store
Policy string
PolicyVersion string
DeploymentSHA256 string
MaxMessageBytes int
Timeout time.Duration
MaxMessageAge time.Duration
MaxConcurrent int
MaxRequestsPerMinute int
MaxGuardCallsPerHour int
Now func() time.Time
}
type ReceiveInput ¶
type ReceiveInput struct {
Envelope Envelope `json:"envelope"`
}
type ReceiveOutput ¶
type ReceiveOutput struct {
Status string `json:"status"`
MessageID string `json:"message_id"`
Decision string `json:"decision"`
ReasonCode string `json:"reason_code"`
Acknowledgement *Acknowledgement `json:"acknowledgement,omitempty"`
AuditSequence uint64 `json:"audit_sequence"`
AuditHead string `json:"audit_head"`
}
type SendInput ¶
type SendInput struct {
Destination string `json:"destination" jsonschema:"configured peer identity"`
Text string `json:"text" jsonschema:"exact text proposed for transfer"`
RequestID string `json:"request_id,omitempty" jsonschema:"optional idempotency key"`
ConversationID string `json:"conversation_id,omitempty" jsonschema:"optional correlation ID"`
}
type SendOutput ¶
type SendOutput struct {
Status string `json:"status"`
MessageID string `json:"message_id"`
RequestID string `json:"request_id"`
BodySHA256 string `json:"body_sha256"`
Decision string `json:"decision"`
ReasonCode string `json:"reason_code"`
Envelope *Envelope `json:"envelope,omitempty"`
AuditSequence uint64 `json:"audit_sequence"`
AuditHead string `json:"audit_head"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Checkpoint ¶
func (s *Service) Checkpoint() (identity.Checkpoint, error)
func (*Service) Confirm ¶
func (s *Service) Confirm(ctx context.Context, input ConfirmInput) (ConfirmOutput, error)
func (*Service) Inbox ¶
func (s *Service) Inbox(_ context.Context, input InboxInput) (InboxOutput, error)
func (*Service) Receive ¶
func (s *Service) Receive(ctx context.Context, input ReceiveInput) (ReceiveOutput, error)
Click to show internal directories.
Click to hide internal directories.