common

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotCommandInfo

type BotCommandInfo struct {
	Name  string `json:"name"`
	BotID int64  `json:"botId"`
}

type BridgeDiagnosticsCapabilities

type BridgeDiagnosticsCapabilities struct {
	InspectChatRoom         BridgeDiagnosticsCapability `json:"inspectChatRoom"`
	OpenChatRoom            BridgeDiagnosticsCapability `json:"openChatRoom"`
	SnapshotChatRoomMembers BridgeDiagnosticsCapability `json:"snapshotChatRoomMembers"`
	SendText                BridgeDiagnosticsCapability `json:"sendText"`
	SendMarkdown            BridgeDiagnosticsCapability `json:"sendMarkdown"`
}

type BridgeDiagnosticsCapability

type BridgeDiagnosticsCapability struct {
	Supported bool    `json:"supported"`
	Ready     bool    `json:"ready"`
	Reason    *string `json:"reason,omitempty"`
}

type BridgeDiscoveryHook

type BridgeDiscoveryHook struct {
	Name            string  `json:"name"`
	Installed       bool    `json:"installed"`
	InstallError    *string `json:"installError,omitempty"`
	InvocationCount int     `json:"invocationCount"`
	LastSeenEpochMs *int64  `json:"lastSeenEpochMs,omitempty"`
	LastSummary     *string `json:"lastSummary,omitempty"`
}

type BridgeHealthCheck

type BridgeHealthCheck struct {
	Name   string  `json:"name"`
	OK     bool    `json:"ok"`
	Detail *string `json:"detail,omitempty"`
}

type BridgeHealthResult

type BridgeHealthResult struct {
	Reachable                 bool                          `json:"reachable"`
	Running                   bool                          `json:"running"`
	SpecReady                 bool                          `json:"specReady"`
	CheckedAtEpochMs          *int64                        `json:"checkedAtEpochMs,omitempty"`
	RestartCount              int                           `json:"restartCount"`
	LastCrashMessage          *string                       `json:"lastCrashMessage,omitempty"`
	Checks                    []BridgeHealthCheck           `json:"checks"`
	DiscoveryInstallAttempted bool                          `json:"discoveryInstallAttempted"`
	DiscoveryHooks            []BridgeDiscoveryHook         `json:"discoveryHooks"`
	Capabilities              BridgeDiagnosticsCapabilities `json:"capabilities"`
	Error                     *string                       `json:"error,omitempty"`
}

type CertReloadResponse

type CertReloadResponse struct {
	Status string `json:"status"`
}

type ConfigDiscoveredState

type ConfigDiscoveredState struct {
	BotID int64 `json:"botId"`
}

type ConfigPendingRestart

type ConfigPendingRestart struct {
	Required bool     `json:"required"`
	Fields   []string `json:"fields"`
}

type ConfigResponse

type ConfigResponse struct {
	User           ConfigState           `json:"user"`
	Applied        ConfigState           `json:"applied"`
	Discovered     ConfigDiscoveredState `json:"discovered"`
	PendingRestart ConfigPendingRestart  `json:"pending_restart"`
}

type ConfigState

type ConfigState struct {
	BotName                string              `json:"bot_name"`
	WebEndpoint            string              `json:"web_endpoint"`
	Webhooks               map[string]string   `json:"webhooks"`
	BotHTTPPort            int                 `json:"bot_http_port"`
	DBPollingRate          int64               `json:"db_polling_rate"`
	MessageSendRate        int64               `json:"message_send_rate"`
	ReplyImageDir          string              `json:"reply_image_dir"`
	CommandRoutePrefixes   map[string][]string `json:"command_route_prefixes"`
	ImageMessageTypeRoutes map[string][]string `json:"image_message_type_routes"`
	EventTypeRoutes        map[string][]string `json:"event_type_routes"`
}

type ConfigUpdateRequest

type ConfigUpdateRequest struct {
	Endpoint                          *string             `json:"endpoint,omitempty"`
	Route                             *string             `json:"route,omitempty"`
	Rate                              *int64              `json:"rate,omitempty"`
	Port                              *int                `json:"port,omitempty"`
	CommandRoutePrefixes              map[string][]string `json:"commandRoutePrefixes,omitempty"`
	ImageMessageTypeRoutes            map[string][]string `json:"imageMessageTypeRoutes,omitempty"`
	EventTypeRoutes                   map[string][]string `json:"eventTypeRoutes,omitempty"`
	ForwardUnmatchedMessagesToDefault *bool               `json:"forwardUnmatchedMessagesToDefault,omitempty"`
	ExpectedRevision                  *uint64             `json:"expectedRevision,omitempty"`
}

type ConfigUpdateResponse

type ConfigUpdateResponse struct {
	Success         bool                  `json:"success"`
	Name            string                `json:"name"`
	Persisted       bool                  `json:"persisted"`
	Applied         bool                  `json:"applied"`
	RequiresRestart bool                  `json:"requiresRestart"`
	User            ConfigState           `json:"user"`
	RuntimeApplied  ConfigState           `json:"runtimeApplied"`
	Discovered      ConfigDiscoveredState `json:"discovered"`
	PendingRestart  ConfigPendingRestart  `json:"pending_restart"`
}

type ImagePartSpec

type ImagePartSpec struct {
	Index       int    `json:"index"`
	SHA256Hex   string `json:"sha256Hex"`
	ByteLength  int64  `json:"byteLength"`
	ContentType string `json:"contentType"`
}

type KeyCacheStats

type KeyCacheStats struct {
	Hits   uint64 `json:"hits"`
	Misses uint64 `json:"misses"`
}

type MemberActivityResponse

type MemberActivityResponse struct {
	UserID         int64          `json:"userId"`
	Nickname       *string        `json:"nickname,omitempty"`
	MessageCount   int            `json:"messageCount"`
	FirstMessageAt *int64         `json:"firstMessageAt,omitempty"`
	LastMessageAt  *int64         `json:"lastMessageAt,omitempty"`
	ActiveHours    []int          `json:"activeHours"`
	MessageTypes   map[string]int `json:"messageTypes"`
}

type MemberInfo

type MemberInfo struct {
	UserID          int64   `json:"userId"`
	Nickname        *string `json:"nickname,omitempty"`
	Role            string  `json:"role"`
	RoleCode        int     `json:"roleCode"`
	ProfileImageURL *string `json:"profileImageUrl,omitempty"`
	MessageCount    int     `json:"messageCount"`
	LastActiveAt    *int64  `json:"lastActiveAt,omitempty"`
}

type MemberListResponse

type MemberListResponse struct {
	ChatID     int64        `json:"chatId"`
	LinkID     *int64       `json:"linkId,omitempty"`
	Members    []MemberInfo `json:"members"`
	TotalCount int          `json:"totalCount"`
}

type MemberStats

type MemberStats struct {
	UserID       int64          `json:"userId"`
	Nickname     *string        `json:"nickname,omitempty"`
	MessageCount int            `json:"messageCount"`
	LastActiveAt *int64         `json:"lastActiveAt,omitempty"`
	MessageTypes map[string]int `json:"messageTypes"`
}

type NativeCoreDiagnostics

type NativeCoreDiagnostics struct {
	State                       string        `json:"state"`
	BinaryEnvelopeSchemaVersion int           `json:"binaryEnvelopeSchemaVersion"`
	DecryptKeyCache             KeyCacheStats `json:"decryptKeyCache"`
}

type NoticeInfo

type NoticeInfo struct {
	Content   string `json:"content"`
	AuthorID  int64  `json:"authorId"`
	UpdatedAt int64  `json:"updatedAt"`
}

type OpenLinkInfo

type OpenLinkInfo struct {
	Name            *string `json:"name,omitempty"`
	URL             *string `json:"url,omitempty"`
	ProfileImageURL *string `json:"profileImageUrl,omitempty"`
	MemberLimit     *int    `json:"memberLimit,omitempty"`
	Description     *string `json:"description,omitempty"`
	Searchable      *int    `json:"searchable,omitempty"`
}

type PeriodRange

type PeriodRange struct {
	From int64 `json:"from"`
	To   int64 `json:"to"`
}

type ReplyAcceptedResponse

type ReplyAcceptedResponse struct {
	Success   bool   `json:"success"`
	Delivery  string `json:"delivery"`
	RequestID string `json:"requestId"`
	Room      string `json:"room"`
	Type      string `json:"type"`
	Duplicate *bool  `json:"duplicate,omitempty"`
}

type ReplyImageMetadata

type ReplyImageMetadata struct {
	ClientRequestID *string         `json:"clientRequestId,omitempty"`
	Type            string          `json:"type"`
	Room            string          `json:"room"`
	ThreadID        *string         `json:"threadId,omitempty"`
	ThreadScope     *int            `json:"threadScope,omitempty"`
	Images          []ImagePartSpec `json:"images"`
}

type ReplyMention

type ReplyMention struct {
	UserID   ReplyMentionUserID `json:"userId"`
	Nickname string             `json:"nickname,omitempty"`
	At       []int              `json:"at,omitempty"`
	Len      int                `json:"len,omitempty"`
}

func (ReplyMention) MarshalJSON

func (m ReplyMention) MarshalJSON() ([]byte, error)

func (*ReplyMention) UnmarshalJSON

func (m *ReplyMention) UnmarshalJSON(data []byte) error

type ReplyMentionUserID

type ReplyMentionUserID = any

func NormalizeReplyMentionUserID

func NormalizeReplyMentionUserID(value ReplyMentionUserID) (ReplyMentionUserID, error)

type ReplyRequest

type ReplyRequest struct {
	ClientRequestID *string         `json:"clientRequestId,omitempty"`
	Type            string          `json:"type"`
	Room            string          `json:"room"`
	Data            string          `json:"data"`
	ThreadID        *string         `json:"threadId,omitempty"`
	ThreadScope     *int            `json:"threadScope,omitempty"`
	Mentions        []ReplyMention  `json:"mentions,omitempty"`
	AttachmentJSON  json.RawMessage `json:"attachmentJson,omitempty"`
}

type ReplyStatusSnapshot

type ReplyStatusSnapshot struct {
	RequestID        string  `json:"requestId"`
	State            string  `json:"state"`
	UpdatedAtEpochMs int64   `json:"updatedAtEpochMs"`
	Detail           *string `json:"detail,omitempty"`
}

type RoomInfoResponse

type RoomInfoResponse struct {
	ChatID           int64            `json:"chatId"`
	Type             *string          `json:"type,omitempty"`
	LinkID           *int64           `json:"linkId,omitempty"`
	Notices          []NoticeInfo     `json:"notices"`
	BlindedMemberIDs []int64          `json:"blindedMemberIds"`
	BotCommands      []BotCommandInfo `json:"botCommands"`
	OpenLink         *OpenLinkInfo    `json:"openLink,omitempty"`
}

type RoomListResponse

type RoomListResponse struct {
	Rooms []RoomSummary `json:"rooms"`
}

type RoomSummary

type RoomSummary struct {
	ChatID             int64   `json:"chatId"`
	Type               *string `json:"type,omitempty"`
	LinkID             *int64  `json:"linkId,omitempty"`
	ActiveMembersCount *int    `json:"activeMembersCount,omitempty"`
	LinkName           *string `json:"linkName,omitempty"`
	LinkURL            *string `json:"linkUrl,omitempty"`
	MemberLimit        *int    `json:"memberLimit,omitempty"`
	Searchable         *int    `json:"searchable,omitempty"`
	BotRole            *int    `json:"botRole,omitempty"`
}

type StatsResponse

type StatsResponse struct {
	ChatID        int64         `json:"chatId"`
	Period        PeriodRange   `json:"period"`
	TotalMessages int           `json:"totalMessages"`
	ActiveMembers int           `json:"activeMembers"`
	TopMembers    []MemberStats `json:"topMembers"`
}

type TextPingWarmResponse

type TextPingWarmResponse struct {
	Accepted       bool  `json:"accepted"`
	ChatID         int64 `json:"chatId"`
	WarmQueueDepth int   `json:"warmQueueDepth"`
}

Jump to

Keyboard shortcuts

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