Help us shape the future of Go! Take the 2026 Go Developer Survey

commworker

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package commworker implements the communication gateway worker (provider webhooks → instance notifications).

Index

Constants

View Source
const (
	QueueMessageKindInbound = "comm.inbound"
)

QueueMessageKind* constants define comm-worker SQS message kinds.

View Source
const ServiceName = "comm-worker"

ServiceName is the canonical service identifier for the comm worker.

Variables

This section is empty.

Functions

func New

func New(opts ...apptheory.Option) *apptheory.App

New constructs the comm worker app.

func Register

func Register(app *apptheory.App, srv *Server) *apptheory.App

Register registers comm worker routes and hooks with an app.

Types

type InboundAttachment

type InboundAttachment struct {
	ID          string `json:"id"`
	Filename    string `json:"filename"`
	ContentType string `json:"contentType"`
	SizeBytes   int64  `json:"sizeBytes"`
	SHA256      string `json:"sha256,omitempty"`
}

type InboundNotification

type InboundNotification struct {
	Type         string              `json:"type"`
	Channel      string              `json:"channel"` // email|sms|voice
	From         InboundParty        `json:"from"`
	To           *InboundParty       `json:"to,omitempty"` // required for routing; schema allows omitting
	Subject      string              `json:"subject,omitempty"`
	Body         string              `json:"body"`
	BodyMimeType string              `json:"bodyMimeType,omitempty"`
	ReceivedAt   string              `json:"receivedAt"`
	MessageID    string              `json:"messageId"`
	InReplyTo    *string             `json:"inReplyTo,omitempty"`
	Attachments  []InboundAttachment `json:"attachments,omitempty"`
}

InboundNotification matches the communication:inbound notification payload contract.

func (*InboundNotification) Validate

func (n *InboundNotification) Validate() error

type InboundParty

type InboundParty struct {
	Address     string  `json:"address,omitempty"`
	Number      string  `json:"number,omitempty"`
	SoulAgentID *string `json:"soulAgentId,omitempty"`
	DisplayName string  `json:"displayName,omitempty"`
}

func (*InboundParty) Validate

func (p *InboundParty) Validate() error

type QueueMessage

type QueueMessage struct {
	Kind         string              `json:"kind"`
	Provider     string              `json:"provider,omitempty"` // migadu|telnyx|test
	Notification InboundNotification `json:"notification"`
}

QueueMessage is the SQS payload processed by comm-worker.

func (*QueueMessage) Validate

func (m *QueueMessage) Validate() error

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server processes inbound communication events from provider webhooks and delivers them to lesser instances.

func NewServer

func NewServer(cfg config.Config, st commStore, stsClient stsAPI, secretsClient secretsManagerAPI) *Server

NewServer constructs a comm-worker server.

func (*Server) Register

func (s *Server) Register(app *apptheory.App)

Register registers SQS handlers with the provided app.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL