Documentation
¶
Overview ¶
Package integrations connects external messaging transports to the existing bot runtime. It owns delivery receipts and routing, never a second agent or transcript.
Index ¶
- Constants
- type BotRuntime
- type Connection
- type Credentials
- type Options
- type Receipt
- type Service
- func (s *Service) Channels() []shortcuts.Channel
- func (s *Service) Close()
- func (s *Service) Delete(id string) error
- func (s *Service) Events(id string) ([]Receipt, error)
- func (s *Service) Get(id string) (Connection, error)
- func (s *Service) List() ([]Connection, error)
- func (s *Service) Notify(ctx context.Context, n agent.Notification) error
- func (s *Service) Retry(id, eventID string) (Receipt, error)
- func (s *Service) Save(id string, spec Spec) (Connection, error)
- func (s *Service) Send(ctx context.Context, id, text string) error
- func (s *Service) Start()
- func (s *Service) Webhook(w http.ResponseWriter, r *http.Request)
- type Spec
Constants ¶
const Version = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BotRuntime ¶
type Connection ¶
type Credentials ¶
type Receipt ¶
type Receipt struct {
ID string `json:"id"`
IntegrationID string `json:"integrationId"`
ChannelID string `json:"channelId"`
UserID string `json:"userId"`
State string `json:"state"`
ChatID string `json:"chatId,omitempty"`
RunID string `json:"runId,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt string `json:"createdAt"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) List ¶
func (s *Service) List() ([]Connection, error)
type Spec ¶
type Spec struct {
Name string `json:"name"`
Provider string `json:"provider"`
BotID string `json:"botId"`
Mode string `json:"mode"`
Enabled bool `json:"enabled"`
ChannelIDs []string `json:"channelIds"`
UserIDs []string `json:"userIds,omitempty"`
WorkspaceID string `json:"workspaceId,omitempty"` // Slack team, Discord guild, Teams tenant
ApplicationID string `json:"applicationId,omitempty"`
Command string `json:"command,omitempty"`
Notify bool `json:"notify"`
Conditions []agent.Condition `json:"conditions,omitempty"`
Destination string `json:"destination,omitempty"`
ServiceURL string `json:"serviceUrl,omitempty"` // Teams connector, owner-configured
ExpectedRevision int64 `json:"expectedRevision,omitempty"`
Credentials *Credentials `json:"credentials,omitempty"`
}
Spec is a complete configuration. Credentials are write-only; omitted fields preserve existing credentials on update. Revision prevents concurrent overwrites.