platform

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeFileName

func SanitizeFileName(name string) string

SanitizeFileName removes control characters and path separators for safe file handling (CWE-93).

Types

type InboundMessage

type InboundMessage struct {
	Platform          string // "feishu" | "dingtalk" | "wecom"
	SenderID          string
	SessionKey        string // platform-prefixed session key, e.g. "feishu:chatID:userID"
	Content           string
	RawContent        string // original message text with formatting preserved (at-tags, markup)
	Raw               string // original platform event, used by the sender for reply metadata
	PlatformMessageID string // platform-native dedup ID; empty string means no dedup
	MessageTime       int64  // Unix milliseconds from platform; 0 = unknown (fallback to server time)
}

InboundMessage carries a parsed message from any platform.

type OutboundMessage

type OutboundMessage struct {
	SessionKey   string
	Content      string
	ReplyTo      InboundMessage
	MediaPath    string // optional local file path to upload and send
	SourceType   string // "bee" | "worker" | "system" — who sent this message
	SourceID     string // worker_id when SourceType is "worker"
	InboundMsgID string // ID of the bee_platform_messages row that triggered this reply
}

OutboundMessage carries a reply to send back on a platform.

type Platform

type Platform interface {
	ID() string
	Receiver() PlatformReceiverAdapter
	Sender() PlatformSenderAdapter
}

Platform bundles a receiver and sender for a single messaging platform.

type PlatformReceiverAdapter

type PlatformReceiverAdapter interface {
	Start(ctx context.Context, dispatch func(InboundMessage)) error
}

PlatformReceiverAdapter receives inbound messages and dispatches them.

type PlatformSenderAdapter

type PlatformSenderAdapter interface {
	Send(ctx context.Context, msg OutboundMessage) error
}

PlatformSenderAdapter sends outbound messages on a platform.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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