bus

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InferAttachmentKind added in v0.2.7

func InferAttachmentKind(mimeType string) string

Types

type Attachment added in v0.2.7

type Attachment struct {
	ID        string
	Name      string
	MIMEType  string
	Kind      string
	SizeBytes int64
	URL       string
	LocalPath string
	Data      []byte
	Headers   map[string]string
}

type Bus

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

func New

func New(buffer int) *Bus

func (*Bus) ConsumeInbound

func (b *Bus) ConsumeInbound(ctx context.Context) (InboundMessage, error)

func (*Bus) ConsumeOutbound

func (b *Bus) ConsumeOutbound(ctx context.Context) (OutboundMessage, error)

func (*Bus) PublishInbound

func (b *Bus) PublishInbound(ctx context.Context, msg InboundMessage) error

func (*Bus) PublishOutbound

func (b *Bus) PublishOutbound(ctx context.Context, msg OutboundMessage) error

type Delivery added in v0.2.2

type Delivery struct {
	MessageID string
	ReplyToID string
	ThreadID  string
	IsDirect  bool
}

type InboundMessage

type InboundMessage struct {
	Channel     string
	SenderID    string
	ChatID      string
	Content     string
	Attachments []Attachment
	SessionKey  string // usually "channel:chat_id"
	Delivery    Delivery
}

type OutboundMessage

type OutboundMessage struct {
	Channel  string
	ChatID   string
	Content  string
	ReplyTo  string
	Delivery Delivery
}

Jump to

Keyboard shortcuts

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