rebind

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewH2CClient = transport.NewH2CClient

Functions

This section is empty.

Types

type BridgeHealthResult

type BridgeHealthResult = transport.BridgeHealthResult

type ClientOption

type ClientOption = transport.ClientOption

type ConfigResponse

type ConfigResponse = transport.ConfigResponse

type ConfigUpdateRequest

type ConfigUpdateRequest = transport.ConfigUpdateRequest

type ConfigUpdateResponse

type ConfigUpdateResponse = transport.ConfigUpdateResponse

type H2CClient

type H2CClient = transport.H2CClient

type KaringContentListRequest

type KaringContentListRequest = transport.KaringContentListRequest

type KaringDryRunResponse

type KaringDryRunResponse = transport.KaringDryRunResponse

type KaringHololiveRequest

type KaringHololiveRequest = transport.KaringHololiveRequest

type KaringSendRequest

type KaringSendRequest = transport.KaringSendRequest

type NativeCoreDiagnostics

type NativeCoreDiagnostics = transport.NativeCoreDiagnostics

type RebindingClient

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

func NewRebindingClient

func NewRebindingClient(cfg RebindingClientConfig) *RebindingClient

생성자는 실패하지 않고 per-call 검증 의미론을 current()에 보존한다.

func (*RebindingClient) Close

func (c *RebindingClient) Close() error

func (*RebindingClient) GetBridgeHealth

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

func (*RebindingClient) GetChatroomFields

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

func (*RebindingClient) GetConfig

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

func (*RebindingClient) GetNativeCoreDiagnostics

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

func (*RebindingClient) GetReplyStatus

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

func (*RebindingClient) GetRooms

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

func (*RebindingClient) GetRuntimeDiagnostics

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

func (*RebindingClient) GetTextPingDiagnostics

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

func (*RebindingClient) OpenChatroom

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

func (*RebindingClient) Ping

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

func (*RebindingClient) SendImage

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

func (*RebindingClient) SendKaring

func (*RebindingClient) SendKaringContentList

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

func (*RebindingClient) SendKaringHololive

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

func (*RebindingClient) SendMarkdown

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

func (*RebindingClient) SendMessage

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

Sender/control/KaringClient 포워딩은 인터페이스 메서드별로 시그니처가 달라 공통 헬퍼로 추출할 수 없다(가변 반환 타입·SendOption variadic). 각 메서드는 current(ctx)로 활성 H2CClient를 얻어 위임하는 얇은 shim이며, 동일 형태가 의도적이다.

func (*RebindingClient) SendMessageAccepted

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

func (*RebindingClient) SendMultipleImages

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

func (*RebindingClient) UpdateConfig

func (*RebindingClient) WarmTextPing

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

type RebindingClientConfig

type RebindingClientConfig struct {
	ResolveBaseURL func() (string, error)
	BotToken       string
	// ResolveInterval 동안 성공 URL 또는 resolver 오류 snapshot을 재사용한다.
	// 0 이하이면 비동시 호출마다 즉시 resolve하는 기존 의미론을 유지한다.
	ResolveInterval time.Duration
	// StaleCloseGrace만큼 기다린 뒤 교체된 이전 클라이언트를 닫는다. 0이면 즉시 닫는다.
	// 진행 중 요청(특히 h3 active conn)이 있는 환경에서는 per-attempt timeout × retry 이상을 권장.
	StaleCloseGrace time.Duration
	Logger          *slog.Logger
	ClientOptions   []ClientOption
}

RebindingClientConfig는 RebindingClient 구성을 담는다. ResolveBaseURL은 호출 중 mutex를 점유하지 않는다. 한 RebindingClient 안에서는 refresh가 single-flight로 합쳐지지만, 서로 다른 client 인스턴스에서는 동시에 호출될 수 있다.

type ReplyAcceptedResponse

type ReplyAcceptedResponse = transport.ReplyAcceptedResponse

type ReplyStatusSnapshot

type ReplyStatusSnapshot = transport.ReplyStatusSnapshot

type RoomListResponse

type RoomListResponse = transport.RoomListResponse

type SendOption

type SendOption = transport.SendOption

type TextPingWarmResponse

type TextPingWarmResponse = transport.TextPingWarmResponse

Jump to

Keyboard shortcuts

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