Documentation
¶
Index ¶
- Variables
- func WithAttachmentRegistrationTime(ctx context.Context, at time.Time) context.Context
- func WithHubReceipt(ctx context.Context, record HubReceiptRecord) context.Context
- func WithMessageEnvelope(ctx context.Context, record MessageEnvelopeRecord) context.Context
- func WithPairingDeliveryLimits(ctx context.Context, limits map[string]PairingDeliveryLimits) context.Context
- type AppendLifecycle
- type AttachmentDeliveryStore
- type ContextAgentRegistryStore
- type ContextAgentStore
- type ContextLifecycleMessageStore
- type ContextMessageStore
- type ContextRoomStore
- type DuplicateMessageError
- type FileStore
- func (s *FileStore) AcknowledgeAttachmentDeliveryContext(_ context.Context, agentID string, eventID string) error
- func (s *FileStore) AdvanceHubSyncCursorContext(ctx context.Context, cursor HubSyncCursor) error
- func (s *FileStore) AppendHubControlContext(ctx context.Context, records []HubControlRecord) error
- func (s *FileStore) AppendMessage(message protocol.Message) error
- func (s *FileStore) AppendMessageContext(_ context.Context, message protocol.Message) error
- func (s *FileStore) AppendMessageEventWithLifecycleContext(ctx context.Context, message protocol.Message, event protocol.Event) (AppendLifecycle, error)
- func (s *FileStore) AppendMessageWithLifecycleContext(ctx context.Context, message protocol.Message) (AppendLifecycle, error)
- func (s *FileStore) AppendMessageWithPairingDeliveriesContext(ctx context.Context, message protocol.Message, event *protocol.Event, ...) (AppendLifecycle, error)
- func (s *FileStore) ApplyPairingDeliveryResultsContext(ctx context.Context, results []PairingDeliveryResult) error
- func (s *FileStore) AttachHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
- func (s *FileStore) BindPairingDeliveryDestinationContext(ctx context.Context, id, remote string) (int, error)
- func (s *FileStore) CompletePairingDeliveryContext(ctx context.Context, pairingID, messageID string) error
- func (s *FileStore) CreateHubRoomContext(ctx context.Context, room HubRoom, genesis HubControlRecord) error
- func (s *FileStore) CreateRoom(room protocol.Room) error
- func (s *FileStore) CreateRoomContext(_ context.Context, room protocol.Room) error
- func (s *FileStore) GetDirectConversationContext(ctx context.Context, dmID string) (protocol.DirectConversation, bool, error)
- func (s *FileStore) GetRoom(id string) (protocol.Room, bool, error)
- func (s *FileStore) GetRoomContext(ctx context.Context, id string) (protocol.Room, bool, error)
- func (s *FileStore) GetThread(id string) (protocol.Thread, bool, error)
- func (s *FileStore) GetThreadContext(ctx context.Context, id string) (protocol.Thread, bool, error)
- func (s *FileStore) Health(context.Context) error
- func (s *FileStore) ListArtifacts(filter protocol.ArtifactFilter, before string, limit int) (protocol.ArtifactPage, error)
- func (s *FileStore) ListArtifactsContext(ctx context.Context, filter protocol.ArtifactFilter, page protocol.PageRequest) (protocol.ArtifactPage, error)
- func (s *FileStore) ListDMMessages(dmID string, before string, limit int) (protocol.MessagePage, error)
- func (s *FileStore) ListDMMessagesContext(ctx context.Context, dmID string, page protocol.PageRequest) (protocol.MessagePage, error)
- func (s *FileStore) ListDirectConversations() ([]protocol.DirectConversation, error)
- func (s *FileStore) ListDirectConversationsContext(ctx context.Context) ([]protocol.DirectConversation, error)
- func (s *FileStore) ListRoomMessages(roomID string, before string, limit int) (protocol.MessagePage, error)
- func (s *FileStore) ListRoomMessagesContext(ctx context.Context, roomID string, page protocol.PageRequest) (protocol.MessagePage, error)
- func (s *FileStore) ListRooms() ([]protocol.Room, error)
- func (s *FileStore) ListRoomsContext(ctx context.Context) ([]protocol.Room, error)
- func (s *FileStore) ListThreadMessages(threadID string, before string, limit int) (protocol.MessagePage, error)
- func (s *FileStore) ListThreadMessagesContext(ctx context.Context, threadID string, page protocol.PageRequest) (protocol.MessagePage, error)
- func (s *FileStore) ListThreads(roomID string) ([]protocol.Thread, error)
- func (s *FileStore) ListThreadsContext(ctx context.Context, roomID string) ([]protocol.Thread, error)
- func (s *FileStore) NextHubOriginSeqContext(ctx context.Context, globalRoomID string) (int64, error)
- func (s *FileStore) PrepareAttachmentDeliveryContext(_ context.Context, agentID string) ([]protocol.Event, error)
- func (s *FileStore) PrunePairingDeliveriesContext(ctx context.Context, pairingID string, now time.Time, maxAge time.Duration, ...) (int, error)
- func (s *FileStore) ReconcilePairingDeliveriesContext(ctx context.Context, destinations map[string]string) (map[string]int, error)
- func (s *FileStore) ReconcileRegisteredAgentContext(_ context.Context, registration protocol.AgentRegistration) (protocol.AgentRegistration, error)
- func (s *FileStore) ReconcileRoom(room protocol.Room) (protocol.Room, error)
- func (s *FileStore) ReconcileRoomContext(_ context.Context, room protocol.Room) (protocol.Room, error)
- func (s *FileStore) RegisterAgentContext(_ context.Context, registration protocol.AgentRegistration) (RegistrationResult, error)
- func (s *FileStore) RemoveAgent(agentID string) error
- func (s *FileStore) RemoveAgentContext(_ context.Context, agentID string) error
- func (s *FileStore) RemoveRegisteredAgentContext(_ context.Context, agentID string) error
- func (s *FileStore) RemoveRoom(roomID string) error
- func (s *FileStore) RemoveRoomContext(_ context.Context, roomID string) error
- func (s *FileStore) ReplaceOutboundEnvelopeContext(ctx context.Context, record MessageEnvelopeRecord) error
- func (s *FileStore) SetFollowCheckpoint(ctx context.Context, key string, value follow.Checkpoint) error
- func (s *FileStore) SetFollowCheckpoints(ctx context.Context, values map[string]follow.Checkpoint, ...) error
- func (s *FileStore) StoreHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
- func (s *FileStore) UpdatePairingDeliveryContext(ctx context.Context, delivery PairingDelivery, lastError string) error
- func (s *FileStore) UpdateRoomMembers(roomID string, add []string, remove []string) (protocol.Room, error)
- func (s *FileStore) UpdateRoomMembersContext(_ context.Context, roomID string, add []string, remove []string) (protocol.Room, error)
- type HealthChecker
- type HubControlRecord
- type HubReceiptRecord
- type HubRoom
- type HubStore
- type HubSyncCursor
- type HubSyncStore
- type MemoryStore
- func (s *MemoryStore) AcknowledgeAttachmentDeliveryContext(_ context.Context, agentID string, eventID string) error
- func (s *MemoryStore) AdvanceHubSyncCursorContext(_ context.Context, cursor HubSyncCursor) error
- func (s *MemoryStore) AppendHubControlContext(_ context.Context, records []HubControlRecord) error
- func (s *MemoryStore) AppendMessage(message protocol.Message) error
- func (s *MemoryStore) AppendMessageContext(_ context.Context, message protocol.Message) error
- func (s *MemoryStore) AppendMessageEventWithLifecycleContext(ctx context.Context, message protocol.Message, event protocol.Event) (AppendLifecycle, error)
- func (s *MemoryStore) AppendMessageWithLifecycleContext(ctx context.Context, message protocol.Message) (AppendLifecycle, error)
- func (s *MemoryStore) AppendMessageWithPairingDeliveriesContext(ctx context.Context, message protocol.Message, event *protocol.Event, ...) (AppendLifecycle, error)
- func (s *MemoryStore) ApplyPairingDeliveryResultsContext(_ context.Context, results []PairingDeliveryResult) error
- func (s *MemoryStore) AttachHubReceiptContext(_ context.Context, record HubReceiptRecord) error
- func (s *MemoryStore) BindPairingDeliveryDestinationContext(_ context.Context, id, remote string) (int, error)
- func (s *MemoryStore) CompletePairingDeliveryContext(_ context.Context, pairingID, messageID string) error
- func (s *MemoryStore) CreateHubRoomContext(_ context.Context, room HubRoom, genesis HubControlRecord) error
- func (s *MemoryStore) CreateRoom(room protocol.Room) error
- func (s *MemoryStore) CreateRoomContext(_ context.Context, room protocol.Room) error
- func (s *MemoryStore) EnvelopeForOriginContext(_ context.Context, originNetworkID, originMessageID string) (MessageEnvelopeRecord, bool, error)
- func (s *MemoryStore) GetAgentContext(_ context.Context, agentID string) (protocol.AgentSummary, bool, error)
- func (s *MemoryStore) GetDirectConversationContext(_ context.Context, dmID string) (protocol.DirectConversation, bool, error)
- func (s *MemoryStore) GetFollowCheckpoint(_ context.Context, key string) (follow.Checkpoint, error)
- func (s *MemoryStore) GetRegisteredAgentByCredentialKeyContext(_ context.Context, credentialKey string) (protocol.AgentRegistration, bool, error)
- func (s *MemoryStore) GetRegisteredAgentContext(_ context.Context, agentID string) (protocol.AgentRegistration, bool, error)
- func (s *MemoryStore) GetRoom(id string) (protocol.Room, bool, error)
- func (s *MemoryStore) GetRoomContext(_ context.Context, id string) (protocol.Room, bool, error)
- func (s *MemoryStore) GetThread(id string) (protocol.Thread, bool, error)
- func (s *MemoryStore) GetThreadContext(_ context.Context, id string) (protocol.Thread, bool, error)
- func (s *MemoryStore) Health(context.Context) error
- func (s *MemoryStore) HubControlLogContext(_ context.Context, globalRoomID string, afterSeq int64) ([]HubControlRecord, error)
- func (s *MemoryStore) HubMessagesContext(_ context.Context, messageIDs []string) (map[string]protocol.Message, error)
- func (s *MemoryStore) HubReceiptForEventContext(_ context.Context, globalRoomID, eventID string) (HubReceiptRecord, bool, error)
- func (s *MemoryStore) HubReceiptHeadContext(_ context.Context, globalRoomID string, hubEpoch int64) (HubReceiptRecord, bool, error)
- func (s *MemoryStore) HubReceiptsAfterContext(_ context.Context, globalRoomID string, hubEpoch, afterSeq int64, limit int) ([]HubReceiptRecord, error)
- func (s *MemoryStore) HubReceiptsForMessagesContext(_ context.Context, messageIDs []string) (map[string]HubReceiptRecord, error)
- func (s *MemoryStore) HubRoomsContext(context.Context) ([]HubRoom, error)
- func (s *MemoryStore) HubSyncCursorContext(_ context.Context, globalRoomID string) (HubSyncCursor, error)
- func (s *MemoryStore) HubWithheldReceiptsContext(_ context.Context, globalRoomID string) ([]HubReceiptRecord, error)
- func (s *MemoryStore) ListAgentsContext(_ context.Context) ([]protocol.AgentSummary, error)
- func (s *MemoryStore) ListArtifacts(filter protocol.ArtifactFilter, before string, limit int) (protocol.ArtifactPage, error)
- func (s *MemoryStore) ListArtifactsContext(_ context.Context, filter protocol.ArtifactFilter, page protocol.PageRequest) (protocol.ArtifactPage, error)
- func (s *MemoryStore) ListDMMessages(dmID string, before string, limit int) (protocol.MessagePage, error)
- func (s *MemoryStore) ListDMMessagesContext(_ context.Context, dmID string, page protocol.PageRequest) (protocol.MessagePage, error)
- func (s *MemoryStore) ListDirectConversations() ([]protocol.DirectConversation, error)
- func (s *MemoryStore) ListDirectConversationsContext(_ context.Context) ([]protocol.DirectConversation, error)
- func (s *MemoryStore) ListPairingDeliveryHeadsContext(_ context.Context) ([]PairingDelivery, error)
- func (s *MemoryStore) ListRegisteredAgentsContext(_ context.Context) ([]protocol.AgentRegistration, error)
- func (s *MemoryStore) ListRoomMessages(roomID string, before string, limit int) (protocol.MessagePage, error)
- func (s *MemoryStore) ListRoomMessagesContext(_ context.Context, roomID string, page protocol.PageRequest) (protocol.MessagePage, error)
- func (s *MemoryStore) ListRooms() ([]protocol.Room, error)
- func (s *MemoryStore) ListRoomsContext(_ context.Context) ([]protocol.Room, error)
- func (s *MemoryStore) ListThreadMessages(threadID string, before string, limit int) (protocol.MessagePage, error)
- func (s *MemoryStore) ListThreadMessagesContext(_ context.Context, threadID string, page protocol.PageRequest) (protocol.MessagePage, error)
- func (s *MemoryStore) ListThreads(roomID string) ([]protocol.Thread, error)
- func (s *MemoryStore) ListThreadsContext(_ context.Context, roomID string) ([]protocol.Thread, error)
- func (s *MemoryStore) MessageEnvelopesContext(_ context.Context, messageIDs []string) (map[string]MessageEnvelopeRecord, error)
- func (s *MemoryStore) NextHubOriginSeqContext(_ context.Context, globalRoomID string) (int64, error)
- func (s *MemoryStore) PairingDeliveryStateContext(_ context.Context, pairingID string) (PairingDeliveryState, error)
- func (s *MemoryStore) PrepareAttachmentDeliveryContext(_ context.Context, agentID string) ([]protocol.Event, error)
- func (s *MemoryStore) PrunePairingDeliveriesContext(_ context.Context, pairingID string, now time.Time, maxAge time.Duration, ...) (int, error)
- func (s *MemoryStore) ReconcilePairingDeliveriesContext(_ context.Context, destinations map[string]string) (map[string]int, error)
- func (s *MemoryStore) ReconcileRegisteredAgentContext(_ context.Context, registration protocol.AgentRegistration) (protocol.AgentRegistration, error)
- func (s *MemoryStore) ReconcileRoom(room protocol.Room) (protocol.Room, error)
- func (s *MemoryStore) ReconcileRoomContext(_ context.Context, room protocol.Room) (protocol.Room, error)
- func (s *MemoryStore) RegisterAgentContext(_ context.Context, registration protocol.AgentRegistration) (RegistrationResult, error)
- func (s *MemoryStore) RemoveAgent(agentID string) error
- func (s *MemoryStore) RemoveAgentContext(_ context.Context, agentID string) error
- func (s *MemoryStore) RemoveRegisteredAgentContext(_ context.Context, agentID string) error
- func (s *MemoryStore) RemoveRoom(roomID string) error
- func (s *MemoryStore) RemoveRoomContext(_ context.Context, roomID string) error
- func (s *MemoryStore) ReplaceOutboundEnvelopeContext(_ context.Context, record MessageEnvelopeRecord) error
- func (s *MemoryStore) SetFollowCheckpoint(ctx context.Context, key string, value follow.Checkpoint) error
- func (s *MemoryStore) SetFollowCheckpoints(ctx context.Context, values map[string]follow.Checkpoint, ...) error
- func (s *MemoryStore) StoreHubReceiptContext(_ context.Context, record HubReceiptRecord) error
- func (s *MemoryStore) UpdatePairingDeliveryContext(_ context.Context, delivery PairingDelivery, lastError string) error
- func (s *MemoryStore) UpdateRoomMembers(roomID string, add []string, remove []string) (protocol.Room, error)
- func (s *MemoryStore) UpdateRoomMembersContext(_ context.Context, roomID string, add []string, remove []string) (protocol.Room, error)
- type MessageEnvelopeRecord
- type MessageEnvelopeStore
- type MessageStore
- type PairingDelivery
- type PairingDeliveryLimits
- type PairingDeliveryResult
- type PairingDeliveryState
- type PairingDeliveryStore
- type RegistrationResult
- type RoomStore
- type SQLStore
- func (s *SQLStore) AcknowledgeAttachmentDeliveryContext(ctx context.Context, agentID string, eventID string) error
- func (s *SQLStore) AdvanceHubSyncCursorContext(ctx context.Context, cursor HubSyncCursor) error
- func (s *SQLStore) AppendHubControlContext(ctx context.Context, records []HubControlRecord) error
- func (s *SQLStore) AppendMessage(message protocol.Message) error
- func (s *SQLStore) AppendMessageContext(ctx context.Context, message protocol.Message) error
- func (s *SQLStore) AppendMessageEventWithLifecycleContext(ctx context.Context, message protocol.Message, event protocol.Event) (AppendLifecycle, error)
- func (s *SQLStore) AppendMessageWithLifecycleContext(ctx context.Context, message protocol.Message) (AppendLifecycle, error)
- func (s *SQLStore) AppendMessageWithPairingDeliveriesContext(ctx context.Context, message protocol.Message, event *protocol.Event, ...) (AppendLifecycle, error)
- func (s *SQLStore) ApplyPairingDeliveryResultsContext(ctx context.Context, results []PairingDeliveryResult) error
- func (s *SQLStore) AttachHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
- func (s *SQLStore) BindPairingDeliveryDestinationContext(ctx context.Context, id, remote string) (int, error)
- func (s *SQLStore) Close() error
- func (s *SQLStore) CompletePairingDeliveryContext(ctx context.Context, pairingID, messageID string) error
- func (s *SQLStore) CreateHubRoomContext(ctx context.Context, room HubRoom, genesis HubControlRecord) error
- func (s *SQLStore) CreateRoom(room protocol.Room) error
- func (s *SQLStore) CreateRoomContext(ctx context.Context, room protocol.Room) error
- func (s *SQLStore) EnvelopeForOriginContext(ctx context.Context, originNetworkID, originMessageID string) (MessageEnvelopeRecord, bool, error)
- func (s *SQLStore) GetAgentContext(ctx context.Context, agentID string) (protocol.AgentSummary, bool, error)
- func (s *SQLStore) GetDirectConversationContext(ctx context.Context, dmID string) (protocol.DirectConversation, bool, error)
- func (s *SQLStore) GetFollowCheckpoint(ctx context.Context, key string) (follow.Checkpoint, error)
- func (s *SQLStore) GetRegisteredAgentByCredentialKeyContext(ctx context.Context, credentialKey string) (protocol.AgentRegistration, bool, error)
- func (s *SQLStore) GetRegisteredAgentContext(ctx context.Context, agentID string) (protocol.AgentRegistration, bool, error)
- func (s *SQLStore) GetRoom(id string) (protocol.Room, bool, error)
- func (s *SQLStore) GetRoomContext(ctx context.Context, id string) (protocol.Room, bool, error)
- func (s *SQLStore) GetThread(id string) (protocol.Thread, bool, error)
- func (s *SQLStore) GetThreadContext(ctx context.Context, id string) (protocol.Thread, bool, error)
- func (s *SQLStore) Health(ctx context.Context) error
- func (s *SQLStore) HubControlLogContext(ctx context.Context, globalRoomID string, afterSeq int64) ([]HubControlRecord, error)
- func (s *SQLStore) HubMessagesContext(ctx context.Context, messageIDs []string) (map[string]protocol.Message, error)
- func (s *SQLStore) HubReceiptForEventContext(ctx context.Context, globalRoomID, eventID string) (HubReceiptRecord, bool, error)
- func (s *SQLStore) HubReceiptHeadContext(ctx context.Context, globalRoomID string, hubEpoch int64) (HubReceiptRecord, bool, error)
- func (s *SQLStore) HubReceiptsAfterContext(ctx context.Context, globalRoomID string, hubEpoch, afterSeq int64, limit int) ([]HubReceiptRecord, error)
- func (s *SQLStore) HubReceiptsForMessagesContext(ctx context.Context, messageIDs []string) (map[string]HubReceiptRecord, error)
- func (s *SQLStore) HubRoomsContext(ctx context.Context) ([]HubRoom, error)
- func (s *SQLStore) HubSyncCursorContext(ctx context.Context, globalRoomID string) (HubSyncCursor, error)
- func (s *SQLStore) HubWithheldReceiptsContext(ctx context.Context, globalRoomID string) ([]HubReceiptRecord, error)
- func (s *SQLStore) ListAgentsContext(ctx context.Context) ([]protocol.AgentSummary, error)
- func (s *SQLStore) ListArtifacts(filter protocol.ArtifactFilter, before string, limit int) (protocol.ArtifactPage, error)
- func (s *SQLStore) ListArtifactsContext(ctx context.Context, filter protocol.ArtifactFilter, page protocol.PageRequest) (protocol.ArtifactPage, error)
- func (s *SQLStore) ListDMMessages(dmID string, before string, limit int) (protocol.MessagePage, error)
- func (s *SQLStore) ListDMMessagesContext(ctx context.Context, dmID string, page protocol.PageRequest) (protocol.MessagePage, error)
- func (s *SQLStore) ListDirectConversations() ([]protocol.DirectConversation, error)
- func (s *SQLStore) ListDirectConversationsContext(ctx context.Context) ([]protocol.DirectConversation, error)
- func (s *SQLStore) ListPairingDeliveryHeadsContext(ctx context.Context) ([]PairingDelivery, error)
- func (s *SQLStore) ListRegisteredAgentsContext(ctx context.Context) ([]protocol.AgentRegistration, error)
- func (s *SQLStore) ListRoomMessages(roomID string, before string, limit int) (protocol.MessagePage, error)
- func (s *SQLStore) ListRoomMessagesContext(ctx context.Context, roomID string, page protocol.PageRequest) (protocol.MessagePage, error)
- func (s *SQLStore) ListRooms() ([]protocol.Room, error)
- func (s *SQLStore) ListRoomsContext(ctx context.Context) ([]protocol.Room, error)
- func (s *SQLStore) ListThreadMessages(threadID string, before string, limit int) (protocol.MessagePage, error)
- func (s *SQLStore) ListThreadMessagesContext(ctx context.Context, threadID string, page protocol.PageRequest) (protocol.MessagePage, error)
- func (s *SQLStore) ListThreads(roomID string) ([]protocol.Thread, error)
- func (s *SQLStore) ListThreadsContext(ctx context.Context, roomID string) ([]protocol.Thread, error)
- func (s *SQLStore) MessageEnvelopesContext(ctx context.Context, messageIDs []string) (map[string]MessageEnvelopeRecord, error)
- func (s *SQLStore) NextHubOriginSeqContext(ctx context.Context, globalRoomID string) (int64, error)
- func (s *SQLStore) PairingDeliveryStateContext(ctx context.Context, pairingID string) (PairingDeliveryState, error)
- func (s *SQLStore) PrepareAttachmentDeliveryContext(ctx context.Context, agentID string) ([]protocol.Event, error)
- func (s *SQLStore) PrunePairingDeliveriesContext(ctx context.Context, pairingID string, now time.Time, maxAge time.Duration, ...) (int, error)
- func (s *SQLStore) ReconcilePairingDeliveriesContext(ctx context.Context, destinations map[string]string) (map[string]int, error)
- func (s *SQLStore) ReconcileRegisteredAgentContext(ctx context.Context, registration protocol.AgentRegistration) (protocol.AgentRegistration, error)
- func (s *SQLStore) ReconcileRoom(room protocol.Room) (protocol.Room, error)
- func (s *SQLStore) ReconcileRoomContext(ctx context.Context, room protocol.Room) (protocol.Room, error)
- func (s *SQLStore) RegisterAgentContext(ctx context.Context, registration protocol.AgentRegistration) (RegistrationResult, error)
- func (s *SQLStore) RemoveAgent(agentID string) error
- func (s *SQLStore) RemoveAgentContext(ctx context.Context, agentID string) error
- func (s *SQLStore) RemoveRegisteredAgentContext(ctx context.Context, agentID string) error
- func (s *SQLStore) RemoveRoom(roomID string) error
- func (s *SQLStore) RemoveRoomContext(ctx context.Context, roomID string) error
- func (s *SQLStore) ReplaceOutboundEnvelopeContext(ctx context.Context, record MessageEnvelopeRecord) error
- func (s *SQLStore) SetFollowCheckpoint(ctx context.Context, key string, value follow.Checkpoint) error
- func (s *SQLStore) SetFollowCheckpoints(ctx context.Context, values map[string]follow.Checkpoint, ...) error
- func (s *SQLStore) SetNow(now func() (time.Time, error))
- func (s *SQLStore) StoreHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
- func (s *SQLStore) UpdatePairingDeliveryContext(ctx context.Context, delivery PairingDelivery, lastError string) error
- func (s *SQLStore) UpdateRoomMembers(roomID string, add []string, remove []string) (protocol.Room, error)
- func (s *SQLStore) UpdateRoomMembersContext(ctx context.Context, roomID string, add []string, remove []string) (protocol.Room, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrMessageIDConflict = errors.New("message id belongs to another origin") ErrDuplicateMessage = errors.New("message already exists") ErrDMTopologyConflict = errors.New("direct conversation topology conflict") ErrRoomExists = errors.New("room already exists") ErrRoomNotFound = errors.New("room not found") ErrInvalidCursor = errors.New("invalid cursor") ErrAgentCredential = errors.New("agent credential mismatch") )
var ( // ErrHubRoomExists means a global room id or its local room is taken. ErrHubRoomExists = errors.New("hub room already exists") // ErrHubControlConflict means a control event does not extend the // stored log: a gap, or a different event at an already stored seq. ErrHubControlConflict = errors.New("room control event conflicts with the stored log") // ErrHubReceiptConflict means a receipt contradicts a stored one: a // different receipt at the same (room, hub epoch, room seq), a different // placement of the same event, or a broken receipt chain. It is never // acknowledged as a duplicate. ErrHubReceiptConflict = errors.New("room receipt conflicts with a stored receipt") )
var ErrEnvelopeConflict = errors.New("origin message already stored with a different envelope")
ErrEnvelopeConflict means a pairing delivered an origin message tuple that is already stored under a different envelope digest: an origin fork or a forgery attempt. It is never acknowledged as a duplicate.
var ErrHubSyncRollback = errors.New("hub room sync would roll back verified order")
ErrHubSyncRollback means a member's sync cursor would move backwards or to a different receipt at the same seq: the home is rewriting order the member already verified.
Functions ¶
func WithAttachmentRegistrationTime ¶ added in v0.1.19
WithAttachmentRegistrationTime carries the already validated registration timestamp into cursor initialization. Reading the clock again after the claim commits could exhaust its range and prevent the issued token reaching READY. Only the service supplies this value; it is never taken from a wire request.
func WithHubReceipt ¶ added in v0.1.22
func WithHubReceipt(ctx context.Context, record HubReceiptRecord) context.Context
WithHubReceipt attaches the receipt to persist atomically with the next message append on ctx.
func WithMessageEnvelope ¶ added in v0.1.22
func WithMessageEnvelope(ctx context.Context, record MessageEnvelopeRecord) context.Context
WithMessageEnvelope attaches the envelope to persist atomically with the next message append on ctx. The same digest also guards the origin receipt: a retry with a different digest is ErrEnvelopeConflict.
func WithPairingDeliveryLimits ¶ added in v0.1.21
Types ¶
type AppendLifecycle ¶
type AttachmentDeliveryStore ¶ added in v0.1.18
type AttachmentDeliveryStore interface {
AppendMessageEventWithLifecycleContext(context.Context, protocol.Message, protocol.Event) (AppendLifecycle, error)
PrepareAttachmentDeliveryContext(context.Context, string) ([]protocol.Event, error)
AcknowledgeAttachmentDeliveryContext(context.Context, string, string) error
}
AttachmentDeliveryStore makes message delivery resumable independently of the in-memory event broker. Preparing an agent with no cursor establishes a baseline at the current durable head; only later unacknowledged events replay.
type ContextAgentRegistryStore ¶
type ContextAgentRegistryStore interface {
RegisterAgentContext(ctx context.Context, registration protocol.AgentRegistration) (RegistrationResult, error)
ReconcileRegisteredAgentContext(ctx context.Context, registration protocol.AgentRegistration) (protocol.AgentRegistration, error)
ListRegisteredAgentsContext(ctx context.Context) ([]protocol.AgentRegistration, error)
GetRegisteredAgentContext(ctx context.Context, agentID string) (protocol.AgentRegistration, bool, error)
GetRegisteredAgentByCredentialKeyContext(ctx context.Context, credentialKey string) (protocol.AgentRegistration, bool, error)
RemoveRegisteredAgentContext(ctx context.Context, agentID string) error
}
type ContextAgentStore ¶
type ContextMessageStore ¶
type ContextMessageStore interface {
AppendMessageContext(ctx context.Context, message protocol.Message) error
ListRoomMessagesContext(ctx context.Context, roomID string, page protocol.PageRequest) (protocol.MessagePage, error)
ListThreadsContext(ctx context.Context, roomID string) ([]protocol.Thread, error)
ListThreadMessagesContext(ctx context.Context, threadID string, page protocol.PageRequest) (protocol.MessagePage, error)
ListDirectConversationsContext(ctx context.Context) ([]protocol.DirectConversation, error)
GetDirectConversationContext(ctx context.Context, dmID string) (protocol.DirectConversation, bool, error)
ListDMMessagesContext(ctx context.Context, dmID string, page protocol.PageRequest) (protocol.MessagePage, error)
ListArtifactsContext(ctx context.Context, filter protocol.ArtifactFilter, page protocol.PageRequest) (protocol.ArtifactPage, error)
}
type ContextRoomStore ¶
type ContextRoomStore interface {
CreateRoomContext(ctx context.Context, room protocol.Room) error
GetRoomContext(ctx context.Context, id string) (protocol.Room, bool, error)
GetThreadContext(ctx context.Context, id string) (protocol.Thread, bool, error)
ListRoomsContext(ctx context.Context) ([]protocol.Room, error)
RemoveAgentContext(ctx context.Context, agentID string) error
RemoveRoomContext(ctx context.Context, roomID string) error
ReconcileRoomContext(ctx context.Context, room protocol.Room) (protocol.Room, error)
UpdateRoomMembersContext(ctx context.Context, roomID string, add []string, remove []string) (protocol.Room, error)
}
type DuplicateMessageError ¶ added in v0.1.21
type DuplicateMessageError struct{ MessageID string }
DuplicateMessageError retains the stored ID when an origin retry uses a new ID.
func (*DuplicateMessageError) Error ¶ added in v0.1.21
func (e *DuplicateMessageError) Error() string
func (*DuplicateMessageError) Unwrap ¶ added in v0.1.21
func (e *DuplicateMessageError) Unwrap() error
type FileStore ¶
type FileStore struct {
*MemoryStore
// contains filtered or unexported fields
}
func NewFileStore ¶
func (*FileStore) AcknowledgeAttachmentDeliveryContext ¶ added in v0.1.18
func (*FileStore) AdvanceHubSyncCursorContext ¶ added in v0.1.22
func (s *FileStore) AdvanceHubSyncCursorContext(ctx context.Context, cursor HubSyncCursor) error
func (*FileStore) AppendHubControlContext ¶ added in v0.1.22
func (s *FileStore) AppendHubControlContext(ctx context.Context, records []HubControlRecord) error
func (*FileStore) AppendMessageContext ¶
func (*FileStore) AppendMessageEventWithLifecycleContext ¶ added in v0.1.18
func (*FileStore) AppendMessageWithLifecycleContext ¶
func (*FileStore) AppendMessageWithPairingDeliveriesContext ¶ added in v0.1.21
func (*FileStore) ApplyPairingDeliveryResultsContext ¶ added in v0.1.21
func (s *FileStore) ApplyPairingDeliveryResultsContext(ctx context.Context, results []PairingDeliveryResult) error
func (*FileStore) AttachHubReceiptContext ¶ added in v0.1.22
func (s *FileStore) AttachHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
func (*FileStore) BindPairingDeliveryDestinationContext ¶ added in v0.1.21
func (*FileStore) CompletePairingDeliveryContext ¶ added in v0.1.21
func (*FileStore) CreateHubRoomContext ¶ added in v0.1.22
func (*FileStore) CreateRoomContext ¶
func (*FileStore) GetDirectConversationContext ¶
func (*FileStore) GetRoomContext ¶
func (*FileStore) GetThreadContext ¶
func (*FileStore) ListArtifacts ¶
func (s *FileStore) ListArtifacts(filter protocol.ArtifactFilter, before string, limit int) (protocol.ArtifactPage, error)
func (*FileStore) ListArtifactsContext ¶
func (s *FileStore) ListArtifactsContext(ctx context.Context, filter protocol.ArtifactFilter, page protocol.PageRequest) (protocol.ArtifactPage, error)
func (*FileStore) ListDMMessages ¶
func (*FileStore) ListDMMessagesContext ¶
func (s *FileStore) ListDMMessagesContext(ctx context.Context, dmID string, page protocol.PageRequest) (protocol.MessagePage, error)
func (*FileStore) ListDirectConversations ¶
func (s *FileStore) ListDirectConversations() ([]protocol.DirectConversation, error)
func (*FileStore) ListDirectConversationsContext ¶
func (*FileStore) ListRoomMessages ¶
func (*FileStore) ListRoomMessagesContext ¶
func (s *FileStore) ListRoomMessagesContext(ctx context.Context, roomID string, page protocol.PageRequest) (protocol.MessagePage, error)
func (*FileStore) ListRoomsContext ¶
func (*FileStore) ListThreadMessages ¶
func (*FileStore) ListThreadMessagesContext ¶
func (s *FileStore) ListThreadMessagesContext(ctx context.Context, threadID string, page protocol.PageRequest) (protocol.MessagePage, error)
func (*FileStore) ListThreads ¶
func (*FileStore) ListThreadsContext ¶
func (*FileStore) NextHubOriginSeqContext ¶ added in v0.1.22
func (*FileStore) PrepareAttachmentDeliveryContext ¶ added in v0.1.18
func (*FileStore) PrunePairingDeliveriesContext ¶ added in v0.1.21
func (*FileStore) ReconcilePairingDeliveriesContext ¶ added in v0.1.21
func (*FileStore) ReconcileRegisteredAgentContext ¶ added in v0.1.12
func (s *FileStore) ReconcileRegisteredAgentContext( _ context.Context, registration protocol.AgentRegistration, ) (protocol.AgentRegistration, error)
func (*FileStore) ReconcileRoom ¶ added in v0.1.11
func (*FileStore) ReconcileRoomContext ¶ added in v0.1.11
func (*FileStore) RegisterAgentContext ¶
func (s *FileStore) RegisterAgentContext( _ context.Context, registration protocol.AgentRegistration, ) (RegistrationResult, error)
func (*FileStore) RemoveAgent ¶ added in v0.1.10
func (*FileStore) RemoveAgentContext ¶ added in v0.1.10
func (*FileStore) RemoveRegisteredAgentContext ¶ added in v0.1.10
func (*FileStore) RemoveRoom ¶ added in v0.1.10
func (*FileStore) RemoveRoomContext ¶ added in v0.1.10
func (*FileStore) ReplaceOutboundEnvelopeContext ¶ added in v0.1.22
func (s *FileStore) ReplaceOutboundEnvelopeContext(ctx context.Context, record MessageEnvelopeRecord) error
func (*FileStore) SetFollowCheckpoint ¶ added in v0.1.20
func (*FileStore) SetFollowCheckpoints ¶ added in v0.1.20
func (*FileStore) StoreHubReceiptContext ¶ added in v0.1.22
func (s *FileStore) StoreHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
func (*FileStore) UpdatePairingDeliveryContext ¶ added in v0.1.21
func (*FileStore) UpdateRoomMembers ¶
type HealthChecker ¶
type HubControlRecord ¶ added in v0.1.22
type HubControlRecord struct {
GlobalRoomID string `json:"global_room_id"`
Seq int64 `json:"seq"`
Digest string `json:"digest"`
Control protocol.SignedRoomControl `json:"control"`
}
HubControlRecord is one stored, already verified control event.
type HubReceiptRecord ¶ added in v0.1.22
type HubReceiptRecord struct {
GlobalRoomID string `json:"global_room_id"`
HubEpoch int64 `json:"hub_epoch"`
// MembershipEpoch is the receipt's signed membership epoch; it never
// decreases along room seqs.
MembershipEpoch int64 `json:"membership_epoch,omitempty"`
RoomSeq int64 `json:"room_seq"`
EventID string `json:"event_id"`
Digest string `json:"digest"`
PrevDigest string `json:"prev_digest,omitempty"`
MessageID string `json:"message_id"`
Receipt protocol.SignedRoomReceipt `json:"receipt"`
// Withheld is why a member holds this receipt without a message it may
// see (protocol.RoomSyncWithheldTooLarge); empty otherwise.
Withheld string `json:"withheld,omitempty"`
}
HubReceiptRecord is one stored, already verified receipt, bound to the local message it placed.
type HubRoom ¶ added in v0.1.22
type HubRoom struct {
GlobalRoomID string `json:"global_room_id"`
LocalRoomID string `json:"local_room_id"`
HomeNetworkID string `json:"home_network_id"`
HomePairingID string `json:"home_pairing_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
HubRoom maps a global room id onto a local room. HomePairingID is empty on the home itself and names the pairing that reaches the home elsewhere.
type HubStore ¶ added in v0.1.22
type HubStore interface {
CreateHubRoomContext(ctx context.Context, room HubRoom, genesis HubControlRecord) error
HubRoomsContext(ctx context.Context) ([]HubRoom, error)
// AppendHubControlContext appends records that must continue the stored
// log contiguously; re-appending an identical stored record is a no-op.
AppendHubControlContext(ctx context.Context, records []HubControlRecord) error
HubControlLogContext(ctx context.Context, globalRoomID string, afterSeq int64) ([]HubControlRecord, error)
HubReceiptHeadContext(ctx context.Context, globalRoomID string, hubEpoch int64) (HubReceiptRecord, bool, error)
HubReceiptForEventContext(ctx context.Context, globalRoomID, eventID string) (HubReceiptRecord, bool, error)
HubReceiptsForMessagesContext(ctx context.Context, messageIDs []string) (map[string]HubReceiptRecord, error)
// NextHubOriginSeqContext reserves this network's next per-room origin
// sequence number. Gaps are harmless; reuse never happens.
NextHubOriginSeqContext(ctx context.Context, globalRoomID string) (int64, error)
// ReplaceOutboundEnvelopeContext re-signs a local, not yet placed
// message after a membership epoch change.
ReplaceOutboundEnvelopeContext(ctx context.Context, record MessageEnvelopeRecord) error
HubSyncStore
}
HubStore persists hub rooms, their control logs and message receipts. Receipts are written inside the message append (WithHubReceipt), so seq, receipt, history and fanout commit together.
type HubSyncCursor ¶ added in v0.1.22
type HubSyncCursor struct {
GlobalRoomID string `json:"global_room_id"`
Seq int64 `json:"seq"`
Digest string `json:"digest,omitempty"`
// MembershipEpoch is that receipt's membership epoch: the floor every
// later receipt's epoch is held to.
MembershipEpoch int64 `json:"membership_epoch,omitempty"`
}
HubSyncCursor is a member's last room seq whose receipt chain it has verified contiguously from the first seq, and that receipt's digest.
type HubSyncStore ¶ added in v0.1.22
type HubSyncStore interface {
// HubReceiptsAfterContext lists receipts after afterSeq in room order.
HubReceiptsAfterContext(ctx context.Context, globalRoomID string, hubEpoch, afterSeq int64, limit int) ([]HubReceiptRecord, error)
HubMessagesContext(ctx context.Context, messageIDs []string) (map[string]protocol.Message, error)
HubSyncCursorContext(ctx context.Context, globalRoomID string) (HubSyncCursor, error)
// AdvanceHubSyncCursorContext moves the cursor forward only.
AdvanceHubSyncCursorContext(ctx context.Context, cursor HubSyncCursor) error
// AttachHubReceiptContext stores the receipt for a message already
// stored here (an origin's own copy), under the append conflict rules.
AttachHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
// StoreHubReceiptContext stores a verified receipt with no message (one
// the member may not see, or refused), under the same conflict rules.
StoreHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
// EnvelopeForOriginContext finds a stored envelope by origin tuple.
EnvelopeForOriginContext(ctx context.Context, originNetworkID, originMessageID string) (MessageEnvelopeRecord, bool, error)
// HubWithheldReceiptsContext lists receipts stored as withheld (a
// visible message the home did not give) that no message has bound.
HubWithheldReceiptsContext(ctx context.Context, globalRoomID string) ([]HubReceiptRecord, error)
}
HubSyncStore is the catch-up half of HubStore.
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) AcknowledgeAttachmentDeliveryContext ¶ added in v0.1.18
func (*MemoryStore) AdvanceHubSyncCursorContext ¶ added in v0.1.22
func (s *MemoryStore) AdvanceHubSyncCursorContext(_ context.Context, cursor HubSyncCursor) error
func (*MemoryStore) AppendHubControlContext ¶ added in v0.1.22
func (s *MemoryStore) AppendHubControlContext(_ context.Context, records []HubControlRecord) error
func (*MemoryStore) AppendMessage ¶
func (s *MemoryStore) AppendMessage(message protocol.Message) error
func (*MemoryStore) AppendMessageContext ¶
func (*MemoryStore) AppendMessageEventWithLifecycleContext ¶ added in v0.1.18
func (s *MemoryStore) AppendMessageEventWithLifecycleContext( ctx context.Context, message protocol.Message, event protocol.Event, ) (AppendLifecycle, error)
func (*MemoryStore) AppendMessageWithLifecycleContext ¶
func (s *MemoryStore) AppendMessageWithLifecycleContext(ctx context.Context, message protocol.Message) (AppendLifecycle, error)
func (*MemoryStore) AppendMessageWithPairingDeliveriesContext ¶ added in v0.1.21
func (s *MemoryStore) AppendMessageWithPairingDeliveriesContext( ctx context.Context, message protocol.Message, event *protocol.Event, pairingIDs []string, ) (AppendLifecycle, error)
func (*MemoryStore) ApplyPairingDeliveryResultsContext ¶ added in v0.1.21
func (s *MemoryStore) ApplyPairingDeliveryResultsContext(_ context.Context, results []PairingDeliveryResult) error
func (*MemoryStore) AttachHubReceiptContext ¶ added in v0.1.22
func (s *MemoryStore) AttachHubReceiptContext(_ context.Context, record HubReceiptRecord) error
func (*MemoryStore) BindPairingDeliveryDestinationContext ¶ added in v0.1.21
func (s *MemoryStore) BindPairingDeliveryDestinationContext(_ context.Context, id, remote string) (int, error)
Discovery binds the queue and its durable default in the same critical section.
func (*MemoryStore) CompletePairingDeliveryContext ¶ added in v0.1.21
func (s *MemoryStore) CompletePairingDeliveryContext(_ context.Context, pairingID, messageID string) error
func (*MemoryStore) CreateHubRoomContext ¶ added in v0.1.22
func (s *MemoryStore) CreateHubRoomContext(_ context.Context, room HubRoom, genesis HubControlRecord) error
func (*MemoryStore) CreateRoom ¶
func (s *MemoryStore) CreateRoom(room protocol.Room) error
func (*MemoryStore) CreateRoomContext ¶
func (*MemoryStore) EnvelopeForOriginContext ¶ added in v0.1.22
func (s *MemoryStore) EnvelopeForOriginContext(_ context.Context, originNetworkID, originMessageID string) (MessageEnvelopeRecord, bool, error)
func (*MemoryStore) GetAgentContext ¶
func (s *MemoryStore) GetAgentContext(_ context.Context, agentID string) (protocol.AgentSummary, bool, error)
func (*MemoryStore) GetDirectConversationContext ¶
func (s *MemoryStore) GetDirectConversationContext( _ context.Context, dmID string, ) (protocol.DirectConversation, bool, error)
func (*MemoryStore) GetFollowCheckpoint ¶ added in v0.1.20
func (s *MemoryStore) GetFollowCheckpoint(_ context.Context, key string) (follow.Checkpoint, error)
func (*MemoryStore) GetRegisteredAgentByCredentialKeyContext ¶ added in v0.1.1
func (s *MemoryStore) GetRegisteredAgentByCredentialKeyContext( _ context.Context, credentialKey string, ) (protocol.AgentRegistration, bool, error)
func (*MemoryStore) GetRegisteredAgentContext ¶
func (s *MemoryStore) GetRegisteredAgentContext( _ context.Context, agentID string, ) (protocol.AgentRegistration, bool, error)
func (*MemoryStore) GetRoomContext ¶
func (*MemoryStore) GetThreadContext ¶
func (*MemoryStore) HubControlLogContext ¶ added in v0.1.22
func (s *MemoryStore) HubControlLogContext(_ context.Context, globalRoomID string, afterSeq int64) ([]HubControlRecord, error)
func (*MemoryStore) HubMessagesContext ¶ added in v0.1.22
func (*MemoryStore) HubReceiptForEventContext ¶ added in v0.1.22
func (s *MemoryStore) HubReceiptForEventContext(_ context.Context, globalRoomID, eventID string) (HubReceiptRecord, bool, error)
func (*MemoryStore) HubReceiptHeadContext ¶ added in v0.1.22
func (s *MemoryStore) HubReceiptHeadContext(_ context.Context, globalRoomID string, hubEpoch int64) (HubReceiptRecord, bool, error)
func (*MemoryStore) HubReceiptsAfterContext ¶ added in v0.1.22
func (s *MemoryStore) HubReceiptsAfterContext(_ context.Context, globalRoomID string, hubEpoch, afterSeq int64, limit int) ([]HubReceiptRecord, error)
func (*MemoryStore) HubReceiptsForMessagesContext ¶ added in v0.1.22
func (s *MemoryStore) HubReceiptsForMessagesContext(_ context.Context, messageIDs []string) (map[string]HubReceiptRecord, error)
func (*MemoryStore) HubRoomsContext ¶ added in v0.1.22
func (s *MemoryStore) HubRoomsContext(context.Context) ([]HubRoom, error)
func (*MemoryStore) HubSyncCursorContext ¶ added in v0.1.22
func (s *MemoryStore) HubSyncCursorContext(_ context.Context, globalRoomID string) (HubSyncCursor, error)
func (*MemoryStore) HubWithheldReceiptsContext ¶ added in v0.1.22
func (s *MemoryStore) HubWithheldReceiptsContext(_ context.Context, globalRoomID string) ([]HubReceiptRecord, error)
func (*MemoryStore) ListAgentsContext ¶
func (s *MemoryStore) ListAgentsContext(_ context.Context) ([]protocol.AgentSummary, error)
func (*MemoryStore) ListArtifacts ¶
func (s *MemoryStore) ListArtifacts( filter protocol.ArtifactFilter, before string, limit int, ) (protocol.ArtifactPage, error)
func (*MemoryStore) ListArtifactsContext ¶
func (s *MemoryStore) ListArtifactsContext( _ context.Context, filter protocol.ArtifactFilter, page protocol.PageRequest, ) (protocol.ArtifactPage, error)
func (*MemoryStore) ListDMMessages ¶
func (s *MemoryStore) ListDMMessages(dmID string, before string, limit int) (protocol.MessagePage, error)
func (*MemoryStore) ListDMMessagesContext ¶
func (s *MemoryStore) ListDMMessagesContext( _ context.Context, dmID string, page protocol.PageRequest, ) (protocol.MessagePage, error)
func (*MemoryStore) ListDirectConversations ¶
func (s *MemoryStore) ListDirectConversations() ([]protocol.DirectConversation, error)
func (*MemoryStore) ListDirectConversationsContext ¶
func (s *MemoryStore) ListDirectConversationsContext(_ context.Context) ([]protocol.DirectConversation, error)
func (*MemoryStore) ListPairingDeliveryHeadsContext ¶ added in v0.1.21
func (s *MemoryStore) ListPairingDeliveryHeadsContext(_ context.Context) ([]PairingDelivery, error)
func (*MemoryStore) ListRegisteredAgentsContext ¶
func (s *MemoryStore) ListRegisteredAgentsContext(_ context.Context) ([]protocol.AgentRegistration, error)
func (*MemoryStore) ListRoomMessages ¶
func (s *MemoryStore) ListRoomMessages(roomID string, before string, limit int) (protocol.MessagePage, error)
func (*MemoryStore) ListRoomMessagesContext ¶
func (s *MemoryStore) ListRoomMessagesContext( _ context.Context, roomID string, page protocol.PageRequest, ) (protocol.MessagePage, error)
func (*MemoryStore) ListRoomsContext ¶
func (*MemoryStore) ListThreadMessages ¶
func (s *MemoryStore) ListThreadMessages(threadID string, before string, limit int) (protocol.MessagePage, error)
func (*MemoryStore) ListThreadMessagesContext ¶
func (s *MemoryStore) ListThreadMessagesContext( _ context.Context, threadID string, page protocol.PageRequest, ) (protocol.MessagePage, error)
func (*MemoryStore) ListThreads ¶
func (s *MemoryStore) ListThreads(roomID string) ([]protocol.Thread, error)
func (*MemoryStore) ListThreadsContext ¶
func (*MemoryStore) MessageEnvelopesContext ¶ added in v0.1.22
func (s *MemoryStore) MessageEnvelopesContext(_ context.Context, messageIDs []string) (map[string]MessageEnvelopeRecord, error)
func (*MemoryStore) NextHubOriginSeqContext ¶ added in v0.1.22
func (*MemoryStore) PairingDeliveryStateContext ¶ added in v0.1.21
func (s *MemoryStore) PairingDeliveryStateContext(_ context.Context, pairingID string) (PairingDeliveryState, error)
func (*MemoryStore) PrepareAttachmentDeliveryContext ¶ added in v0.1.18
func (*MemoryStore) PrunePairingDeliveriesContext ¶ added in v0.1.21
func (*MemoryStore) ReconcilePairingDeliveriesContext ¶ added in v0.1.21
func (s *MemoryStore) ReconcilePairingDeliveriesContext(_ context.Context, destinations map[string]string) (map[string]int, error)
Empty destinations and rows are unbound, not evidence of a changed peer.
func (*MemoryStore) ReconcileRegisteredAgentContext ¶ added in v0.1.12
func (s *MemoryStore) ReconcileRegisteredAgentContext( _ context.Context, registration protocol.AgentRegistration, ) (protocol.AgentRegistration, error)
func (*MemoryStore) ReconcileRoom ¶ added in v0.1.11
func (*MemoryStore) ReconcileRoomContext ¶ added in v0.1.11
func (*MemoryStore) RegisterAgentContext ¶
func (s *MemoryStore) RegisterAgentContext( _ context.Context, registration protocol.AgentRegistration, ) (RegistrationResult, error)
func (*MemoryStore) RemoveAgent ¶ added in v0.1.10
func (s *MemoryStore) RemoveAgent(agentID string) error
func (*MemoryStore) RemoveAgentContext ¶ added in v0.1.10
func (s *MemoryStore) RemoveAgentContext(_ context.Context, agentID string) error
func (*MemoryStore) RemoveRegisteredAgentContext ¶ added in v0.1.10
func (s *MemoryStore) RemoveRegisteredAgentContext(_ context.Context, agentID string) error
func (*MemoryStore) RemoveRoom ¶ added in v0.1.10
func (s *MemoryStore) RemoveRoom(roomID string) error
func (*MemoryStore) RemoveRoomContext ¶ added in v0.1.10
func (s *MemoryStore) RemoveRoomContext(_ context.Context, roomID string) error
func (*MemoryStore) ReplaceOutboundEnvelopeContext ¶ added in v0.1.22
func (s *MemoryStore) ReplaceOutboundEnvelopeContext(_ context.Context, record MessageEnvelopeRecord) error
func (*MemoryStore) SetFollowCheckpoint ¶ added in v0.1.20
func (s *MemoryStore) SetFollowCheckpoint(ctx context.Context, key string, value follow.Checkpoint) error
func (*MemoryStore) SetFollowCheckpoints ¶ added in v0.1.20
func (s *MemoryStore) SetFollowCheckpoints(ctx context.Context, values map[string]follow.Checkpoint, deletePrefixes []string) error
SetFollowCheckpoints deletes literal prefixes before applying replacements. The whole page is visible atomically to checkpoint readers.
func (*MemoryStore) StoreHubReceiptContext ¶ added in v0.1.22
func (s *MemoryStore) StoreHubReceiptContext(_ context.Context, record HubReceiptRecord) error
func (*MemoryStore) UpdatePairingDeliveryContext ¶ added in v0.1.21
func (s *MemoryStore) UpdatePairingDeliveryContext(_ context.Context, delivery PairingDelivery, lastError string) error
func (*MemoryStore) UpdateRoomMembers ¶
type MessageEnvelopeRecord ¶ added in v0.1.22
type MessageEnvelopeRecord struct {
MessageID string `json:"message_id"`
OriginNetworkID string `json:"origin_network_id"`
OriginMessageID string `json:"origin_message_id"`
Digest string `json:"digest"`
State string `json:"state"`
Fingerprint string `json:"fingerprint"`
Envelope protocol.SignedEnvelope `json:"envelope"`
}
MessageEnvelopeRecord is the immutable signed envelope stored beside the local message projection. It is written once with the message and never updated; display and verification facts come from it, not the projection.
type MessageEnvelopeStore ¶ added in v0.1.22
type MessageEnvelopeStore interface {
MessageEnvelopesContext(ctx context.Context, messageIDs []string) (map[string]MessageEnvelopeRecord, error)
}
MessageEnvelopeStore reads stored envelopes by local message id.
type MessageStore ¶
type MessageStore interface {
AppendMessage(message protocol.Message) error
ListRoomMessages(roomID string, before string, limit int) (protocol.MessagePage, error)
ListThreads(roomID string) ([]protocol.Thread, error)
ListThreadMessages(threadID string, before string, limit int) (protocol.MessagePage, error)
ListDirectConversations() ([]protocol.DirectConversation, error)
ListDMMessages(dmID string, before string, limit int) (protocol.MessagePage, error)
ListArtifacts(filter protocol.ArtifactFilter, before string, limit int) (protocol.ArtifactPage, error)
}
type PairingDelivery ¶ added in v0.1.21
type PairingDelivery struct {
Sequence int64
PairingID string
RemoteNetworkID string
MessageID string
Message protocol.Message
Attempts int
NextAttempt time.Time
CreatedAt time.Time
}
PairingDelivery is an outbound record committed with the originating message. Sequence orders accepted messages independently of caller timestamps and IDs.
type PairingDeliveryLimits ¶ added in v0.1.21
PairingDeliveryLimits apply in the same transaction as the message append.
type PairingDeliveryResult ¶ added in v0.1.21
type PairingDeliveryResult struct {
Delivery PairingDelivery
LastError string
RejectedReason string
Retry bool
}
PairingDeliveryResult is persisted with the other completed sends in one worker pass. The full delivery identity prevents stale results from changing replacement rows.
type PairingDeliveryState ¶ added in v0.1.21
type PairingDeliveryStore ¶ added in v0.1.21
type PairingDeliveryStore interface {
BindPairingDeliveryDestinationContext(context.Context, string, string) (int, error)
ApplyPairingDeliveryResultsContext(context.Context, []PairingDeliveryResult) error
ReconcilePairingDeliveriesContext(context.Context, map[string]string) (map[string]int, error)
AppendMessageWithPairingDeliveriesContext(context.Context, protocol.Message, *protocol.Event, []string) (AppendLifecycle, error)
ListPairingDeliveryHeadsContext(context.Context) ([]PairingDelivery, error)
UpdatePairingDeliveryContext(context.Context, PairingDelivery, string) error
CompletePairingDeliveryContext(context.Context, string, string) error
PrunePairingDeliveriesContext(context.Context, string, time.Time, time.Duration, int) (int, error)
PairingDeliveryStateContext(context.Context, string) (PairingDeliveryState, error)
}
type RegistrationResult ¶ added in v0.1.19
type RegistrationResult struct {
protocol.AgentRegistration
Created bool
}
RegistrationResult records the outcome of the atomic registration operation. Created is independent of clock precision and is never part of the wire schema.
type RoomStore ¶
type RoomStore interface {
CreateRoom(room protocol.Room) error
GetRoom(id string) (protocol.Room, bool, error)
GetThread(id string) (protocol.Thread, bool, error)
ListRooms() ([]protocol.Room, error)
RemoveAgent(agentID string) error
RemoveRoom(roomID string) error
ReconcileRoom(room protocol.Room) (protocol.Room, error)
UpdateRoomMembers(roomID string, add []string, remove []string) (protocol.Room, error)
}
type SQLStore ¶
type SQLStore struct {
// contains filtered or unexported fields
}
func NewPostgresStore ¶
func NewSQLiteStore ¶
func (*SQLStore) AcknowledgeAttachmentDeliveryContext ¶ added in v0.1.18
func (*SQLStore) AdvanceHubSyncCursorContext ¶ added in v0.1.22
func (s *SQLStore) AdvanceHubSyncCursorContext(ctx context.Context, cursor HubSyncCursor) error
func (*SQLStore) AppendHubControlContext ¶ added in v0.1.22
func (s *SQLStore) AppendHubControlContext(ctx context.Context, records []HubControlRecord) error
func (*SQLStore) AppendMessageContext ¶
func (*SQLStore) AppendMessageEventWithLifecycleContext ¶ added in v0.1.18
func (*SQLStore) AppendMessageWithLifecycleContext ¶
func (*SQLStore) AppendMessageWithPairingDeliveriesContext ¶ added in v0.1.21
func (*SQLStore) ApplyPairingDeliveryResultsContext ¶ added in v0.1.21
func (s *SQLStore) ApplyPairingDeliveryResultsContext(ctx context.Context, results []PairingDeliveryResult) error
func (*SQLStore) AttachHubReceiptContext ¶ added in v0.1.22
func (s *SQLStore) AttachHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
func (*SQLStore) BindPairingDeliveryDestinationContext ¶ added in v0.1.21
func (*SQLStore) CompletePairingDeliveryContext ¶ added in v0.1.21
func (*SQLStore) CreateHubRoomContext ¶ added in v0.1.22
func (*SQLStore) CreateRoomContext ¶
func (*SQLStore) EnvelopeForOriginContext ¶ added in v0.1.22
func (*SQLStore) GetAgentContext ¶
func (*SQLStore) GetDirectConversationContext ¶
func (*SQLStore) GetFollowCheckpoint ¶ added in v0.1.20
func (*SQLStore) GetRegisteredAgentByCredentialKeyContext ¶ added in v0.1.1
func (*SQLStore) GetRegisteredAgentContext ¶
func (*SQLStore) GetRoomContext ¶
func (*SQLStore) GetThreadContext ¶
func (*SQLStore) HubControlLogContext ¶ added in v0.1.22
func (*SQLStore) HubMessagesContext ¶ added in v0.1.22
func (*SQLStore) HubReceiptForEventContext ¶ added in v0.1.22
func (*SQLStore) HubReceiptHeadContext ¶ added in v0.1.22
func (*SQLStore) HubReceiptsAfterContext ¶ added in v0.1.22
func (*SQLStore) HubReceiptsForMessagesContext ¶ added in v0.1.22
func (*SQLStore) HubRoomsContext ¶ added in v0.1.22
func (*SQLStore) HubSyncCursorContext ¶ added in v0.1.22
func (*SQLStore) HubWithheldReceiptsContext ¶ added in v0.1.22
func (*SQLStore) ListAgentsContext ¶
func (*SQLStore) ListArtifacts ¶
func (s *SQLStore) ListArtifacts(filter protocol.ArtifactFilter, before string, limit int) (protocol.ArtifactPage, error)
func (*SQLStore) ListArtifactsContext ¶
func (s *SQLStore) ListArtifactsContext( ctx context.Context, filter protocol.ArtifactFilter, page protocol.PageRequest, ) (protocol.ArtifactPage, error)
func (*SQLStore) ListDMMessages ¶
func (*SQLStore) ListDMMessagesContext ¶
func (s *SQLStore) ListDMMessagesContext( ctx context.Context, dmID string, page protocol.PageRequest, ) (protocol.MessagePage, error)
func (*SQLStore) ListDirectConversations ¶
func (s *SQLStore) ListDirectConversations() ([]protocol.DirectConversation, error)
func (*SQLStore) ListDirectConversationsContext ¶
func (*SQLStore) ListPairingDeliveryHeadsContext ¶ added in v0.1.21
func (s *SQLStore) ListPairingDeliveryHeadsContext(ctx context.Context) ([]PairingDelivery, error)
func (*SQLStore) ListRegisteredAgentsContext ¶
func (*SQLStore) ListRoomMessages ¶
func (*SQLStore) ListRoomMessagesContext ¶
func (s *SQLStore) ListRoomMessagesContext( ctx context.Context, roomID string, page protocol.PageRequest, ) (protocol.MessagePage, error)
func (*SQLStore) ListRoomsContext ¶
func (*SQLStore) ListThreadMessages ¶
func (*SQLStore) ListThreadMessagesContext ¶
func (s *SQLStore) ListThreadMessagesContext( ctx context.Context, threadID string, page protocol.PageRequest, ) (protocol.MessagePage, error)
func (*SQLStore) ListThreads ¶
func (*SQLStore) ListThreadsContext ¶
func (*SQLStore) MessageEnvelopesContext ¶ added in v0.1.22
func (*SQLStore) NextHubOriginSeqContext ¶ added in v0.1.22
func (*SQLStore) PairingDeliveryStateContext ¶ added in v0.1.21
func (*SQLStore) PrepareAttachmentDeliveryContext ¶ added in v0.1.18
func (*SQLStore) PrunePairingDeliveriesContext ¶ added in v0.1.21
func (*SQLStore) ReconcilePairingDeliveriesContext ¶ added in v0.1.21
func (*SQLStore) ReconcileRegisteredAgentContext ¶ added in v0.1.12
func (s *SQLStore) ReconcileRegisteredAgentContext( ctx context.Context, registration protocol.AgentRegistration, ) (protocol.AgentRegistration, error)
func (*SQLStore) ReconcileRoom ¶ added in v0.1.11
func (*SQLStore) ReconcileRoomContext ¶ added in v0.1.11
func (*SQLStore) RegisterAgentContext ¶
func (s *SQLStore) RegisterAgentContext( ctx context.Context, registration protocol.AgentRegistration, ) (RegistrationResult, error)
func (*SQLStore) RemoveAgent ¶ added in v0.1.10
func (*SQLStore) RemoveAgentContext ¶ added in v0.1.10
func (*SQLStore) RemoveRegisteredAgentContext ¶ added in v0.1.10
func (*SQLStore) RemoveRoom ¶ added in v0.1.10
func (*SQLStore) RemoveRoomContext ¶ added in v0.1.10
func (*SQLStore) ReplaceOutboundEnvelopeContext ¶ added in v0.1.22
func (s *SQLStore) ReplaceOutboundEnvelopeContext(ctx context.Context, record MessageEnvelopeRecord) error
func (*SQLStore) SetFollowCheckpoint ¶ added in v0.1.20
func (*SQLStore) SetFollowCheckpoints ¶ added in v0.1.20
func (*SQLStore) SetNow ¶ added in v0.1.19
SetNow injects domain time before serving requests. Migrations, connection timeouts and health deadlines intentionally remain on the real clock.
func (*SQLStore) StoreHubReceiptContext ¶ added in v0.1.22
func (s *SQLStore) StoreHubReceiptContext(ctx context.Context, record HubReceiptRecord) error
func (*SQLStore) UpdatePairingDeliveryContext ¶ added in v0.1.21
func (*SQLStore) UpdateRoomMembers ¶
Source Files
¶
- artifacts.go
- attachment_delivery.go
- clock.go
- context.go
- dm_topology.go
- errors.go
- file_agents.go
- file_pairing_delivery.go
- file_store.go
- file_store_snapshot.go
- follow.go
- health.go
- history.go
- hub.go
- hub_file.go
- hub_memory.go
- hub_receipt_only.go
- hub_sync.go
- memory.go
- memory_pairing_delivery.go
- memory_pairing_delivery_results.go
- message_envelope.go
- page.go
- pagination.go
- pairing_delivery.go
- pairing_delivery_text.go
- room_activity.go
- sql_agents.go
- sql_attachment_delivery.go
- sql_conversations.go
- sql_driver.go
- sql_helpers.go
- sql_hub.go
- sql_hub_sync.go
- sql_message_envelope.go
- sql_messages.go
- sql_migrate.go
- sql_migrations.go
- sql_open.go
- sql_pairing_delivery.go
- sql_pairing_delivery_binding.go
- sql_pairing_delivery_results.go
- sql_pairing_delivery_state.go
- sql_pairing_migrations.go
- sql_query.go
- sql_room_activity.go
- sql_scan.go
- sql_store.go