transport

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PathReply                   = "/reply"
	PathReplyStatus             = "/reply-status"
	PathReady                   = "/ready"
	PathHealth                  = "/health"
	PathConfig                  = "/config"
	PathDiagnosticsBridge       = "/diagnostics/bridge"
	PathDiagnosticsChatroom     = "/diagnostics/chatroom-fields"
	PathDiagnosticsNativeCore   = "/diagnostics/native-core"
	PathDiagnosticsRuntime      = "/diagnostics/runtime"
	PathDiagnosticsTextPing     = "/diagnostics/text-ping"
	PathDiagnosticsChatroomOpen = "/diagnostics/chatroom-open"
	PathAdminCertReload         = "/admin/cert-reload"
	PathKaringSend              = "/karing/send"
	PathKaringContentList       = "/karing/content-list"
	PathKaringHololive          = "/karing/hololive"
	PathRooms                   = "/rooms"
	PathEventsStream            = "/events/stream"

	PathQueryRoomSummary    = "/query/room-summary"
	PathQueryMemberStats    = "/query/member-stats"
	PathQueryRecentThreads  = "/query/recent-threads"
	PathQueryRecentMessages = "/query/recent-messages"
)
View Source
const (
	HeaderIrisTimestamp  = irishmac.HeaderIrisTimestamp
	HeaderIrisNonce      = irishmac.HeaderIrisNonce
	HeaderIrisSignature  = irishmac.HeaderIrisSignature
	HeaderIrisBodySHA256 = irishmac.HeaderIrisBodySHA256
)
View Source
const (
	EventTypeMemberNicknameUpdated    = sse.EventTypeMemberNicknameUpdated
	SSEEventRoomEvent                 = sse.SSEEventRoomEvent
	SSEEventStreamState               = sse.SSEEventStreamState
	StreamCursorStatusCurrent         = sse.StreamCursorStatusCurrent
	StreamCursorStatusStale           = sse.StreamCursorStatusStale
	StreamCursorStatusFuture          = sse.StreamCursorStatusFuture
	StreamRecoveryQueryRecentMessages = sse.StreamRecoveryQueryRecentMessages
)
View Source
const DefaultRawJSONMaxBytes = 1 << 20

Variables

View Source
var (
	ErrRetryable      = errors.New("iris: retryable error")
	ErrPermanent      = errors.New("iris: permanent error")
	ErrAuthFailed     = errors.New("iris: authentication failed")
	ErrRateLimited    = errors.New("iris: rate limited")
	ErrTransport      = errors.New("iris: transport error")
	ErrH3EgressDenied = errors.New("iris: H3 egress denied")

	ErrCertReloadTokenRequired = errors.New("iris: cert-reload requires a dedicated cert-reload token; set WithCertReloadToken")
	ErrInboundSecretRequired   = errors.New("iris: /config* (inbound) route signing requires an inbound secret; set WithInboundSecret or WithHMACSecret (the bot token is not used for inbound signing)")
)
View Source
var (
	ErrEmptyH3CACertFile   = errors.New("iris: IRIS_H3_CA_CERT_FILE is set but empty; refusing to fall back to system roots")
	ErrMissingH3CACertFile = errors.New("iris: no H3 CA cert file configured; set IRIS_H3_CA_CERT_FILE or opt in with WithH3AllowSystemRoots/IRIS_H3_ALLOW_SYSTEM_ROOTS")
)
View Source
var ErrResponseTooLarge = errors.New("iris: response body exceeds maximum allowed size")

Functions

func NewH3DialGuardForBaseURL added in v0.33.0

func NewH3DialGuardForBaseURL(
	ctx context.Context,
	baseURL string,
	opts ...H3DialGuardOption,
) (func(context.Context, net.IP) error, error)

Types

type BotCommandInfo

type BotCommandInfo = common.BotCommandInfo

type BridgeDiagnosticsCapabilities

type BridgeDiagnosticsCapabilities = common.BridgeDiagnosticsCapabilities

type BridgeDiagnosticsCapability

type BridgeDiagnosticsCapability = common.BridgeDiagnosticsCapability

type BridgeDiscoveryHook

type BridgeDiscoveryHook = common.BridgeDiscoveryHook

type BridgeHealthCheck

type BridgeHealthCheck = common.BridgeHealthCheck

type BridgeHealthResult

type BridgeHealthResult = common.BridgeHealthResult

type CertReloadResponse

type CertReloadResponse = common.CertReloadResponse

type ClientOption

type ClientOption func(*clientOptions)

func WithBaseURL

func WithBaseURL(url string) ClientOption

func WithBotControlToken

func WithBotControlToken(secret string) ClientOption

WithBotControlToken은 /reply, /rooms, /events 등 봇 제어 라우트의 HMAC 서명에 사용할 비밀키를 설정합니다.

func WithBotToken

func WithBotToken(token string) ClientOption

func WithCertReloadToken

func WithCertReloadToken(secret string) ClientOption

func WithDialTimeout

func WithDialTimeout(d time.Duration) ClientOption

func WithH3AllowSystemRoots

func WithH3AllowSystemRoots(enabled bool) ClientOption

func WithH3CACertFile

func WithH3CACertFile(path string) ClientOption

func WithH3CACertReloadInterval

func WithH3CACertReloadInterval(interval time.Duration) ClientOption

WithH3CACertReloadInterval은 pinned H3 CA 파일을 주기적으로 리로드하도록 활성화합니다. 값이 > 0이고 CA 파일이 설정돼 있으면, 클라이언트는 이 간격으로 파일을 폴링하다가 CA가 회전하면 새 transport로 원자적으로 교체합니다 — 프로세스 재시작이 필요 없습니다. 0(기본값)은 CA를 한 번만 로드하는 기존 동작을 유지합니다. IRIS_H3_CA_RELOAD_INTERVAL 환경 변수로도 동일하게 제어할 수 있습니다.

func WithH3DialGuard

func WithH3DialGuard(guard func(net.IP) error) ClientOption

WithH3DialGuard는 H3 연결 대상 IP를 검사하는 guard를 설정합니다.

func WithH3DialGuardContext

func WithH3DialGuardContext(guard func(context.Context, net.IP) error) ClientOption

func WithH3DialGuardForBaseURL added in v0.33.0

func WithH3DialGuardForBaseURL(
	ctx context.Context,
	baseURL string,
	opts ...H3DialGuardOption,
) (ClientOption, error)

func WithH3InsecureSkipVerifyForTests

func WithH3InsecureSkipVerifyForTests(enabled bool) ClientOption

func WithH3ServerName

func WithH3ServerName(serverName string) ClientOption

func WithHMACSecret

func WithHMACSecret(secret string) ClientOption

WithHMACSecret는 지정한 비밀키로 HMAC-SHA256 요청 서명을 활성화합니다. 설정하면 bot token 대신 이 값을 모든 라우트의 공유 서명 비밀키로 사용합니다. 라우트별 비밀키를 분리하려면 WithInboundSecret, WithBotControlToken을 사용하세요.

func WithHTTPClient

func WithHTTPClient(c *http.Client) ClientOption

func WithIdleConnTimeout

func WithIdleConnTimeout(d time.Duration) ClientOption

func WithInboundSecret

func WithInboundSecret(secret string) ClientOption

WithInboundSecret는 /config 계열 라우트의 HMAC 서명에 사용할 비밀키를 설정합니다.

func WithLogger

func WithLogger(logger *slog.Logger) ClientOption

func WithMaxConnsPerHost

func WithMaxConnsPerHost(n int) ClientOption

func WithMaxIdleConns

func WithMaxIdleConns(n int) ClientOption

func WithMaxIdleConnsPerHost

func WithMaxIdleConnsPerHost(n int) ClientOption

func WithPingProbeTimeout

func WithPingProbeTimeout(d time.Duration) ClientOption

func WithPingStrategy

func WithPingStrategy(s PingStrategy) ClientOption

func WithPingTimeout

func WithPingTimeout(d time.Duration) ClientOption

func WithReadIdleTimeout

func WithReadIdleTimeout(d time.Duration) ClientOption

func WithReplyRetry

func WithReplyRetry(maxAttempts int) ClientOption

WithReplyRetry는 reply 경로에서만 HTTP 429를 재시도합니다. Iris 서버 계약상 429만 미처리 응답으로 간주할 수 있으므로 다른 오류는 재시도하지 않습니다.

func WithResponseHeaderTimeout

func WithResponseHeaderTimeout(d time.Duration) ClientOption

func WithRoundTripper

func WithRoundTripper(rt http.RoundTripper) ClientOption

func WithTLSHandshakeTimeout

func WithTLSHandshakeTimeout(d time.Duration) ClientOption

func WithTimeout

func WithTimeout(d time.Duration) ClientOption

func WithTransport

func WithTransport(transport string) ClientOption

func WithTransportMetrics added in v0.33.0

func WithTransportMetrics(metrics TransportMetrics) ClientOption

func WithWriteByteTimeout

func WithWriteByteTimeout(d time.Duration) ClientOption

type ConfigDiscoveredState

type ConfigDiscoveredState = common.ConfigDiscoveredState

type ConfigPendingRestart

type ConfigPendingRestart = common.ConfigPendingRestart

type ConfigResponse

type ConfigResponse = common.ConfigResponse

type ConfigState

type ConfigState = common.ConfigState

type ConfigUpdateRequest

type ConfigUpdateRequest = common.ConfigUpdateRequest

type ConfigUpdateResponse

type ConfigUpdateResponse = common.ConfigUpdateResponse

type H2CClient

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

func NewH2CClient

func NewH2CClient(baseURL, botToken string, opts ...ClientOption) *H2CClient

func (*H2CClient) Close

func (c *H2CClient) Close() error

func (*H2CClient) EventStream

func (c *H2CClient) EventStream(ctx context.Context, lastEventID int64) (<-chan RawSSEEvent, error)

EventStream은 /events/stream에 SSE 연결을 열고 이벤트 채널을 반환합니다. context가 취소되거나 서버가 연결을 닫으면 채널이 닫힙니다.

func (*H2CClient) EventStreamReconnect

func (c *H2CClient) EventStreamReconnect(ctx context.Context, lastEventID int64) (<-chan RawSSEEvent, error)

EventStreamReconnect은 /events/stream을 열고, 서버가 닫으면 마지막 수신 id로 재연결합니다. context가 취소되면 반환 채널을 닫습니다.

func (*H2CClient) GetBridgeHealth

func (c *H2CClient) GetBridgeHealth(ctx context.Context) (*BridgeHealthResult, error)

func (*H2CClient) GetChatroomFields

func (c *H2CClient) GetChatroomFields(ctx context.Context, chatID int64) (jsonx.RawMessage, error)

func (*H2CClient) GetConfig

func (c *H2CClient) GetConfig(ctx context.Context) (*ConfigResponse, error)

func (*H2CClient) GetLatestRoomUserEventsByType

func (c *H2CClient) GetLatestRoomUserEventsByType(ctx context.Context, chatID, userID int64, eventType string, limit int) ([]RoomEventRecord, error)

GetLatestRoomUserEventsByType는 지정한 사용자의 최신 채팅방 이벤트 목록을 이벤트 타입으로 필터링해 조회합니다.

func (*H2CClient) GetMemberActivity

func (c *H2CClient) GetMemberActivity(ctx context.Context, chatID, userID int64, period string) (*MemberActivityResponse, error)

func (*H2CClient) GetMembers

func (c *H2CClient) GetMembers(ctx context.Context, chatID int64) (*MemberListResponse, error)

func (*H2CClient) GetMembersWithProfileRefresh

func (c *H2CClient) GetMembersWithProfileRefresh(ctx context.Context, chatID, profileUserID int64) (*MemberListResponse, error)

func (*H2CClient) GetNativeCoreDiagnostics

func (c *H2CClient) GetNativeCoreDiagnostics(ctx context.Context) (*NativeCoreDiagnostics, error)

func (*H2CClient) GetReplyStatus

func (c *H2CClient) GetReplyStatus(ctx context.Context, requestID string) (*ReplyStatusSnapshot, error)

func (*H2CClient) GetRoomEvents

func (c *H2CClient) GetRoomEvents(ctx context.Context, chatID int64, limit int, after int64) ([]RoomEventRecord, error)

GetRoomEvents는 지정한 채팅방의 이벤트 목록을 조회합니다.

func (*H2CClient) GetRoomEventsByType

func (c *H2CClient) GetRoomEventsByType(ctx context.Context, chatID int64, eventType string, limit int, after int64) ([]RoomEventRecord, error)

GetRoomEventsByType는 지정한 채팅방의 이벤트 목록을 이벤트 타입으로 필터링해 조회합니다.

func (*H2CClient) GetRoomInfo

func (c *H2CClient) GetRoomInfo(ctx context.Context, chatID int64) (*RoomInfoResponse, error)

func (*H2CClient) GetRoomStats

func (c *H2CClient) GetRoomStats(ctx context.Context, chatID int64, opts RoomStatsOptions) (*StatsResponse, error)

func (*H2CClient) GetRoomUserEvents

func (c *H2CClient) GetRoomUserEvents(ctx context.Context, chatID, userID int64, limit int, after int64) ([]RoomEventRecord, error)

GetRoomUserEvents는 지정한 사용자의 채팅방 이벤트 목록을 조회합니다.

func (*H2CClient) GetRoomUserEventsByType

func (c *H2CClient) GetRoomUserEventsByType(ctx context.Context, chatID, userID int64, eventType string, limit int, after int64) ([]RoomEventRecord, error)

GetRoomUserEventsByType는 지정한 사용자의 채팅방 이벤트 목록을 이벤트 타입으로 필터링해 조회합니다.

func (*H2CClient) GetRooms

func (c *H2CClient) GetRooms(ctx context.Context) (*RoomListResponse, error)

func (*H2CClient) GetRuntimeDiagnostics

func (c *H2CClient) GetRuntimeDiagnostics(ctx context.Context) (jsonx.RawMessage, error)

func (*H2CClient) GetTextPingDiagnostics

func (c *H2CClient) GetTextPingDiagnostics(ctx context.Context, chatID int64) (jsonx.RawMessage, error)

func (*H2CClient) GetThreads

func (c *H2CClient) GetThreads(ctx context.Context, chatID int64) (*ThreadListResponse, error)

GetThreads는 지정한 채팅방의 스레드 목록을 조회합니다.

func (*H2CClient) InitError

func (c *H2CClient) InitError() error

func (*H2CClient) OpenChatroom

func (c *H2CClient) OpenChatroom(ctx context.Context, chatID int64) (jsonx.RawMessage, error)

func (*H2CClient) Ping

func (c *H2CClient) Ping(ctx context.Context) bool

func (*H2CClient) QueryMemberStats

func (c *H2CClient) QueryMemberStats(ctx context.Context, req QueryMemberStatsRequest) (*StatsResponse, error)

func (*H2CClient) QueryRecentMessages

func (c *H2CClient) QueryRecentMessages(ctx context.Context, req QueryRecentMessagesRequest) (*RecentMessagesResponse, error)

func (*H2CClient) QueryRecentThreads

func (c *H2CClient) QueryRecentThreads(ctx context.Context, chatID int64) (*ThreadListResponse, error)

func (*H2CClient) QueryRoomSummary

func (c *H2CClient) QueryRoomSummary(ctx context.Context, chatID int64) (*RoomSummary, error)

func (*H2CClient) ReloadH3Certificate

func (c *H2CClient) ReloadH3Certificate(ctx context.Context) (*CertReloadResponse, error)

func (*H2CClient) SearchNicknameHistoryExact

func (c *H2CClient) SearchNicknameHistoryExact(ctx context.Context, chatID int64, name string, limit int) (*NicknameHistorySearchResponse, error)

func (*H2CClient) SendImage

func (c *H2CClient) SendImage(ctx context.Context, room string, imageData []byte, opts ...SendOption) (*ReplyAcceptedResponse, error)

func (*H2CClient) SendKaring

func (*H2CClient) SendKaringContentList

func (c *H2CClient) SendKaringContentList(ctx context.Context, req KaringContentListRequest) (*KaringDryRunResponse, error)

func (*H2CClient) SendKaringHololive

func (c *H2CClient) SendKaringHololive(ctx context.Context, req KaringHololiveRequest) (*KaringDryRunResponse, error)

func (*H2CClient) SendMarkdown

func (c *H2CClient) SendMarkdown(ctx context.Context, room, markdown string, opts ...SendOption) (*ReplyAcceptedResponse, error)

func (*H2CClient) SendMessage

func (c *H2CClient) SendMessage(ctx context.Context, room, message string, opts ...SendOption) error

func (*H2CClient) SendMessageAccepted

func (c *H2CClient) SendMessageAccepted(ctx context.Context, room, message string, opts ...SendOption) (*ReplyAcceptedResponse, error)

func (*H2CClient) SendMultipleImages

func (c *H2CClient) SendMultipleImages(ctx context.Context, room string, images [][]byte, opts ...SendOption) (*ReplyAcceptedResponse, error)

func (*H2CClient) UpdateConfig

func (c *H2CClient) UpdateConfig(ctx context.Context, name string, cfgReq ConfigUpdateRequest) (*ConfigUpdateResponse, error)

func (*H2CClient) WarmTextPing

func (c *H2CClient) WarmTextPing(ctx context.Context, chatID int64) (*TextPingWarmResponse, error)

type H3DialGuardOption added in v0.33.0

type H3DialGuardOption func(*h3DialGuardOptions)

func WithH3DialGuardLenientInit added in v0.33.0

func WithH3DialGuardLenientInit() H3DialGuardOption

func WithH3DialGuardLogger added in v0.33.0

func WithH3DialGuardLogger(logger *slog.Logger) H3DialGuardOption

func WithH3DialGuardResolveTimeout added in v0.33.0

func WithH3DialGuardResolveTimeout(timeout time.Duration) H3DialGuardOption

func WithH3DialGuardTTL added in v0.33.0

func WithH3DialGuardTTL(ttl time.Duration) H3DialGuardOption

type HTTPError

type HTTPError struct {
	StatusCode int
	URL        string
	RetryAfter time.Duration
	// Body는 진단 로그용으로 최대 512바이트까지 잘린, best-effort로 민감정보를 가린
	// 응답 본문 스니펫이다. 그래도 호출자는 이 값을 low-trust로 취급해야 한다. redaction은
	// 흔한 헤더 반향(Bearer, Authorization, X-Iris-Secret/Token, X-API-Key, Cookie,
	// Set-Cookie, Signature=)을 가리지만 완전하지 않다. 재검토 없이 Body를 사용자에게
	// 노출되는 표면으로 전달하지 마라.
	Body string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

func (*HTTPError) Is

func (e *HTTPError) Is(target error) bool

func (*HTTPError) LogValue

func (e *HTTPError) LogValue() slog.Value

type KaringClient

type KaringClient interface {
	SendKaring(ctx context.Context, req KaringSendRequest) (*KaringDryRunResponse, error)
	SendKaringContentList(ctx context.Context, req KaringContentListRequest) (*KaringDryRunResponse, error)
	SendKaringHololive(ctx context.Context, req KaringHololiveRequest) (*KaringDryRunResponse, error)
}

type KaringContentItem

type KaringContentItem struct {
	Title        string             `json:"title,omitempty"`
	URL          string             `json:"url,omitempty"`
	MemberName   string             `json:"member_name,omitempty"`
	ChannelName  string             `json:"channel_name,omitempty"`
	Status       KaringStreamStatus `json:"status,omitempty"`
	StartAt      string             `json:"start_at,omitempty"`
	ThumbnailURL string             `json:"thumbnail_url,omitempty"`
	Platform     string             `json:"platform,omitempty"`
}

type KaringContentListRequest

type KaringContentListRequest struct {
	ClientRequestID *string             `json:"clientRequestId,omitempty"`
	Item            *KaringContentItem  `json:"item,omitempty"`
	Items           []KaringContentItem `json:"items,omitempty"`
	ExtraArgs       KaringTemplateArgs  `json:"extra_args,omitempty"`
	ReceiverName    string              `json:"receiver_name,omitempty"`
	ReceiverRoomID  int64               `json:"receiver_room_id,omitempty"`
	TemplateID      int64               `json:"template_id,omitempty"`
	SearchExact     *bool               `json:"search_exact,omitempty"`
	SearchFrom      string              `json:"search_from,omitempty"`
	SearchRoomType  string              `json:"search_room_type,omitempty"`
	DryRun          bool                `json:"dry_run,omitempty"`
}

type KaringDryRunResponse

type KaringDryRunResponse struct {
	OK           bool               `json:"ok"`
	DryRun       bool               `json:"dry_run"`
	ReceiverName string             `json:"receiver_name,omitempty"`
	TemplateID   int64              `json:"template_id"`
	ItemCount    *int               `json:"item_count,omitempty"`
	StreamCount  *int               `json:"stream_count,omitempty"`
	TemplateArgs KaringTemplateArgs `json:"template_args"`
	Success      bool               `json:"success,omitempty"`
	Delivery     string             `json:"delivery,omitempty"`
	RequestID    string             `json:"requestId,omitempty"`
	Kind         string             `json:"kind,omitempty"`
	Duplicate    *bool              `json:"duplicate,omitempty"`
}

func (*KaringDryRunResponse) UnmarshalJSON

func (r *KaringDryRunResponse) UnmarshalJSON(data []byte) error

Iris의 dry-run 응답(KaringDryRunResponse)은 snake_case, live 202 응답(KaringAcceptedResponse)은 camelCase로 직렬화되므로 두 케이싱을 모두 받아 병합한다.

type KaringHololiveRequest

type KaringHololiveRequest struct {
	ClientRequestID *string             `json:"clientRequestId,omitempty"`
	Stream          *KaringContentItem  `json:"stream,omitempty"`
	Streams         []KaringContentItem `json:"streams,omitempty"`
	ExtraArgs       KaringTemplateArgs  `json:"extra_args,omitempty"`
	ReceiverName    string              `json:"receiver_name,omitempty"`
	ReceiverRoomID  int64               `json:"receiver_room_id,omitempty"`
	TemplateID      int64               `json:"template_id,omitempty"`
	SearchExact     *bool               `json:"search_exact,omitempty"`
	SearchFrom      string              `json:"search_from,omitempty"`
	SearchRoomType  string              `json:"search_room_type,omitempty"`
	DryRun          bool                `json:"dry_run,omitempty"`
}

type KaringSendRequest

type KaringSendRequest struct {
	ClientRequestID *string            `json:"clientRequestId,omitempty"`
	ReceiverName    string             `json:"receiver_name,omitempty"`
	ReceiverRoomID  int64              `json:"receiver_room_id,omitempty"`
	TemplateID      int64              `json:"template_id,omitempty"`
	TemplateArgs    KaringTemplateArgs `json:"template_args,omitempty"`
	AppKey          string             `json:"app_key,omitempty"`
	Origin          string             `json:"origin,omitempty"`
	SearchExact     *bool              `json:"search_exact,omitempty"`
	SearchFrom      string             `json:"search_from,omitempty"`
	SearchRoomType  string             `json:"search_room_type,omitempty"`
	DryRun          bool               `json:"dry_run,omitempty"`
}

type KaringStreamStatus

type KaringStreamStatus string
const (
	KaringStreamStatusLive     KaringStreamStatus = "LIVE"
	KaringStreamStatusUpcoming KaringStreamStatus = "UPCOMING"
)

type KaringTemplateArgs

type KaringTemplateArgs map[string]string

type KeyCacheStats

type KeyCacheStats = common.KeyCacheStats

type MemberActivityResponse

type MemberActivityResponse = common.MemberActivityResponse

type MemberInfo

type MemberInfo = common.MemberInfo

type MemberListResponse

type MemberListResponse = common.MemberListResponse

type MemberNicknameUpdatedEvent

type MemberNicknameUpdatedEvent = sse.MemberNicknameUpdatedEvent

type MemberStats

type MemberStats = common.MemberStats

type NativeCoreDiagnostics

type NativeCoreDiagnostics = common.NativeCoreDiagnostics

type NicknameHistoryEntry

type NicknameHistoryEntry struct {
	PreviousDisplayName string `json:"previousDisplayName"`
	CurrentDisplayName  string `json:"currentDisplayName"`
	SourceLogID         int64  `json:"sourceLogId"`
	CreatedAtMs         int64  `json:"createdAtMs"`
}

type NicknameHistorySearchMatch

type NicknameHistorySearchMatch struct {
	UserID         int64                  `json:"userId"`
	LatestNickname string                 `json:"latestNickname"`
	History        []NicknameHistoryEntry `json:"history"`
}

type NicknameHistorySearchResponse

type NicknameHistorySearchResponse struct {
	Complete               bool                         `json:"complete"`
	Truncated              bool                         `json:"truncated"`
	AsOfSourceLogID        int64                        `json:"asOfSourceLogId"`
	DurableHeadSourceLogID int64                        `json:"durableHeadSourceLogId"`
	Matches                []NicknameHistorySearchMatch `json:"matches"`
}

type NoopTransportMetrics added in v0.33.0

type NoopTransportMetrics struct{}

func (NoopTransportMetrics) ObserveReplyRetry added in v0.33.0

func (NoopTransportMetrics) ObserveReplyRetry(_ int, _ time.Duration)

func (NoopTransportMetrics) ObserveReplyRetryAfter added in v0.33.0

func (NoopTransportMetrics) ObserveReplyRetryAfter(_ time.Duration)

func (NoopTransportMetrics) ObserveSSEReconnectAttempt added in v0.33.0

func (NoopTransportMetrics) ObserveSSEReconnectAttempt(_ int)

func (NoopTransportMetrics) ObserveSSEReconnectFailure added in v0.33.0

func (NoopTransportMetrics) ObserveSSEReconnectFailure(_ int)

func (NoopTransportMetrics) ObserveSSEReconnectSuccess added in v0.33.0

func (NoopTransportMetrics) ObserveSSEReconnectSuccess(_ int)

type NoticeInfo

type NoticeInfo = common.NoticeInfo

type OpenLinkInfo

type OpenLinkInfo = common.OpenLinkInfo

type PeriodRange

type PeriodRange = common.PeriodRange

type PingError

type PingError struct {
	URL    string
	Reason string
	Err    error
}

func (*PingError) Error

func (e *PingError) Error() string

func (*PingError) Is

func (e *PingError) Is(target error) bool

func (*PingError) Unwrap

func (e *PingError) Unwrap() error

type PingStrategy

type PingStrategy int
const (
	PingStrategyAuto PingStrategy = iota // 기본값: /ready -> /health -> OPTIONS /reply 순으로 폴백
	PingStrategyReady
	PingStrategyHealth
)

type QueryMemberStatsRequest

type QueryMemberStatsRequest = query.QueryMemberStatsRequest

type QueryRecentMessagesRequest

type QueryRecentMessagesRequest = query.QueryRecentMessagesRequest

type QueryRecentThreadsRequest

type QueryRecentThreadsRequest = query.QueryRecentThreadsRequest

type QueryRoomSummaryRequest

type QueryRoomSummaryRequest = query.QueryRoomSummaryRequest

type RawSSEEvent

type RawSSEEvent = sse.RawSSEEvent

type RecentMessage

type RecentMessage = query.RecentMessage

type RecentMessagesResponse

type RecentMessagesResponse = query.RecentMessagesResponse

type ReplyAcceptedResponse

type ReplyAcceptedResponse = common.ReplyAcceptedResponse

type ReplyMention

type ReplyMention = common.ReplyMention

type ReplyMentionUserID

type ReplyMentionUserID = common.ReplyMentionUserID

type ReplyRequest

type ReplyRequest = common.ReplyRequest

type ReplyStatusSnapshot

type ReplyStatusSnapshot = common.ReplyStatusSnapshot

type RoomEventRecord

type RoomEventRecord = query.RoomEventRecord

type RoomInfoResponse

type RoomInfoResponse = common.RoomInfoResponse

type RoomListResponse

type RoomListResponse = common.RoomListResponse

type RoomStatsOptions

type RoomStatsOptions struct {
	Period      string
	Limit       int
	MinMessages int
}

type RoomSummary

type RoomSummary = common.RoomSummary

type SDKConfig

type SDKConfig struct {
	BaseURL   string
	BotToken  string
	Transport string
}

func ResolveSDKConfig

func ResolveSDKConfig(opts []ClientOption) SDKConfig

type SSERoomEventBody

type SSERoomEventBody = sse.SSERoomEventBody

type SSEStreamState

type SSEStreamState = sse.SSEStreamState

type SecretRole

type SecretRole int
const (
	SecretRoleInbound SecretRole = iota
	SecretRoleBotControl
	SecretRoleCertReload
)

type SendOption

type SendOption func(*sendOptions)

func WithAttachmentJSON

func WithAttachmentJSON(raw json.RawMessage) SendOption

func WithClientRequestID

func WithClientRequestID(id string) SendOption

func WithImageContentType

func WithImageContentType(contentType string) SendOption

func WithMention

func WithMention(mention ReplyMention) SendOption

func WithMentions

func WithMentions(mentions ...ReplyMention) SendOption

func WithThreadID

func WithThreadID(id string) SendOption

func WithThreadScope

func WithThreadScope(scope int) SendOption

type Sender

type Sender interface {
	SendMessage(ctx context.Context, room, message string, opts ...SendOption) error
	SendMessageAccepted(ctx context.Context, room, message string, opts ...SendOption) (*ReplyAcceptedResponse, error)
	SendImage(ctx context.Context, room string, imageData []byte, opts ...SendOption) (*ReplyAcceptedResponse, error)
	SendMultipleImages(ctx context.Context, room string, images [][]byte, opts ...SendOption) (*ReplyAcceptedResponse, error)
	SendMarkdown(ctx context.Context, room, markdown string, opts ...SendOption) (*ReplyAcceptedResponse, error)
	GetReplyStatus(ctx context.Context, requestID string) (*ReplyStatusSnapshot, error)
}

type StatsResponse

type StatsResponse = common.StatsResponse

type TextPingWarmResponse

type TextPingWarmResponse = common.TextPingWarmResponse

type ThreadListResponse

type ThreadListResponse = query.ThreadListResponse

type ThreadSummary

type ThreadSummary = query.ThreadSummary

type TransportError

type TransportError struct {
	Op  string
	URL string
	Err error
}

func (*TransportError) Error

func (e *TransportError) Error() string

func (*TransportError) Is

func (e *TransportError) Is(target error) bool

func (*TransportError) Unwrap

func (e *TransportError) Unwrap() error

type TransportMetrics added in v0.33.0

type TransportMetrics interface {
	ObserveReplyRetry(attempt int, delay time.Duration)
	ObserveReplyRetryAfter(delay time.Duration)
	ObserveSSEReconnectAttempt(attempt int)
	ObserveSSEReconnectFailure(attempt int)
	ObserveSSEReconnectSuccess(attempt int)
}

콜백은 재시도·재연결 경로에서 동기 호출되므로 구현은 동시 호출을 견디고 즉시 반환해야 한다.

Jump to

Keyboard shortcuts

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