Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeliveryClaim ¶
type DeliveryClaim struct {
State DeliveryClaimState
ExistingResponse protocol.MachineResponse
ExistingResolved bool
ExistingAmbiguous bool
ExistingFingerprint string
}
type DeliveryClaimState ¶
type DeliveryClaimState int
const ( DeliveryClaimStateNew DeliveryClaimState = iota DeliveryClaimStateIdenticalPending DeliveryClaimStateIdenticalResolved DeliveryClaimStateChangedConflict DeliveryClaimStateCapacity )
type DeliveryIdentity ¶
type DeliveryIdentityFromSendNudge ¶
type DeliveryIdentityFromSendNudge struct{}
func (DeliveryIdentityFromSendNudge) Identity ¶
func (DeliveryIdentityFromSendNudge) Identity(request protocol.MachineRequest) (DeliveryIdentity, bool)
type DeliveryIdentityResolver ¶
type DeliveryIdentityResolver interface {
Identity(request protocol.MachineRequest) (DeliveryIdentity, bool)
}
type DeliveryRegistry ¶
type DeliveryRegistry interface {
Claim(identity DeliveryIdentity) (DeliveryClaim, error)
Resolve(identity DeliveryIdentity, response protocol.MachineResponse, ambiguous bool) bool
Release(identity DeliveryIdentity) bool
Lookup(identity DeliveryIdentity) (protocol.MachineResponse, bool)
Size() int
}
func NewDeliveryRegistry ¶
func NewDeliveryRegistry(max int) DeliveryRegistry
NewDeliveryRegistry constructs the one bounded registry shared by a Session and its ProviderExecutor. Callers must inject this same value into both.
type DeliveryService ¶
type DeliveryService struct {
// contains filtered or unexported fields
}
DeliveryService records only outcomes that packet 1 cannot infer safely. A release is legal solely before SendMessage is invoked or after an explicit accepted=false response; every post-send uncertainty is retained by packet 1.
func NewDeliveryService ¶
func NewDeliveryService(registry DeliveryRegistry) *DeliveryService
type Executor ¶
type Executor interface {
Execute(ctx context.Context, request protocol.MachineRequest) (protocol.MachineResponse, error)
}
type Provider ¶
type Provider interface {
GetRoom(context.Context, string) (protocol.Room, error)
ListDMs(context.Context) (protocol.DirectConversationPage, error)
ListRoomMessages(context.Context, string, protocol.PageRequest) (protocol.MessagePage, error)
ListDMMessages(context.Context, string, protocol.PageRequest) (protocol.MessagePage, error)
SendMessage(context.Context, protocol.SendMessageRequest) (protocol.MessageAccepted, error)
}
Provider is the narrow, credential-free dependency used by the machine executor. It deliberately mirrors only the client operations machine needs.
type ProviderExecutor ¶
type ProviderExecutor struct {
// contains filtered or unexported fields
}
ProviderExecutor is the concrete packet-2 Executor. It has no HTTP or credential fields: Provider owns transport and DeliveryService owns the shared packet-1 reservation lifecycle.
func NewProviderExecutor ¶
func NewProviderExecutor(attachment clientconfig.AttachmentConfig, provider Provider, registry DeliveryRegistry) *ProviderExecutor
func (*ProviderExecutor) Execute ¶
func (executor *ProviderExecutor) Execute(ctx context.Context, request protocol.MachineRequest) (protocol.MachineResponse, error)
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(ctx context.Context, input io.ReadCloser, writer io.Writer, opts ...SessionOption) *Session
type SessionOption ¶
type SessionOption func(*Session)
func WithDeliveryIdentityResolver ¶
func WithDeliveryIdentityResolver(resolver DeliveryIdentityResolver) SessionOption
func WithDeliveryRegistry ¶
func WithDeliveryRegistry(registry DeliveryRegistry) SessionOption
func WithExecutor ¶
func WithExecutor(executor Executor) SessionOption