Documentation
¶
Index ¶
- func DialChatWebSocketV2(ctx context.Context, address string, cfg httpserver.WebSocketConfig, ...) (contract.ClientStream[ChatRequestV2, ChatResponseV2], error)
- func NewChatWebSocketHandlerV2(cfg httpserver.WebSocketConfig, svc StreamingServiceV2) (http.Handler, error)
- func NewHTTPHandlerV2(svc ServiceV2) http.Handler
- func NewTailSSEHandlerV2(cfg httpserver.SSEConfig, svc StreamingServiceV2) (http.Handler, error)
- func NewWatchSSEHandlerV2(cfg httpserver.SSEConfig, svc StreamingServiceV2) (http.Handler, error)
- func OpenChatLocalV2(ctx context.Context, cfg contract.StreamConfig, svc StreamingServiceV2) (contract.ClientStream[ChatRequestV2, ChatResponseV2], error)
- type ChatRequestV2
- type ChatResponseV2
- type ClientV2
- type EventMetaV2
- type PingRequestV2
- type PingResponseV2
- type ServiceV2
- type StreamReaderV2
- type StreamSenderV2
- type StreamingServiceV2
- type TailResponseV2
- type WatchRequestV2
- type WatchResponseV2
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialChatWebSocketV2 ¶
func DialChatWebSocketV2(ctx context.Context, address string, cfg httpserver.WebSocketConfig, secure contract.SecureClientOptions) (contract.ClientStream[ChatRequestV2, ChatResponseV2], error)
DialChatWebSocketV2 opens the secure remote Bidi Stream for /v2/chat.
func NewChatWebSocketHandlerV2 ¶
func NewChatWebSocketHandlerV2(cfg httpserver.WebSocketConfig, svc StreamingServiceV2) (http.Handler, error)
NewChatWebSocketHandlerV2 builds the authenticated WebSocket adapter for /v2/chat. Mount it through a classified Registry route.
func NewHTTPHandlerV2 ¶
NewHTTPHandlerV2 exposes V2 Unary methods. Mount its routes through the Registry's classified security APIs in strict modes.
func NewTailSSEHandlerV2 ¶
func NewTailSSEHandlerV2(cfg httpserver.SSEConfig, svc StreamingServiceV2) (http.Handler, error)
NewTailSSEHandlerV2 builds the POST + SSE adapter for /v2/tail. Mount the returned handler through a classified Registry route.
func NewWatchSSEHandlerV2 ¶
func NewWatchSSEHandlerV2(cfg httpserver.SSEConfig, svc StreamingServiceV2) (http.Handler, error)
NewWatchSSEHandlerV2 builds the POST + SSE adapter for /v2/watch. Mount the returned handler through a classified Registry route.
func OpenChatLocalV2 ¶
func OpenChatLocalV2(ctx context.Context, cfg contract.StreamConfig, svc StreamingServiceV2) (contract.ClientStream[ChatRequestV2, ChatResponseV2], error)
OpenChatLocalV2 opens a typed local Bidi Stream.
Types ¶
type ChatRequestV2 ¶
type ChatRequestV2 struct {
// Text 必填。
Text string `json:"text"`
}
ChatRequestV2 Chat V2 request DTO.
type ChatResponseV2 ¶
type ChatResponseV2 struct {
Text string `json:"text"`
}
ChatResponseV2 Chat V2 response message DTO.
type ClientV2 ¶
type ClientV2 struct {
// contains filtered or unexported fields
}
ClientV2 is the generated remote binding for V2 Unary methods.
func NewClientV2 ¶
NewClientV2 is the legacy/dev entry point; production callers should use NewSecureClientV2.
func NewSecureClientV2 ¶
func NewSecureClientV2(base string, opts contract.SecureClientOptions) (*ClientV2, error)
NewSecureClientV2 creates the authenticated HTTPS client for V2 Unary methods.
func (*ClientV2) Ping ¶
func (c *ClientV2) Ping(ctx context.Context, req PingRequestV2) (PingResponseV2, error)
type EventMetaV2 ¶
type EventMetaV2 struct {
Source string `json:"source"`
}
EventMetaV2 Additional application event metadata.
type PingRequestV2 ¶
type PingRequestV2 struct {
// Name 必填。
Name string `json:"name"`
}
PingRequestV2 Ping V2 request DTO.
type PingResponseV2 ¶
type PingResponseV2 struct {
Message string `json:"message"`
}
PingResponseV2 Ping V2 response DTO.
type ServiceV2 ¶
type ServiceV2 interface {
// Ping Checks the V2 unary transport.
Ping(ctx context.Context, req PingRequestV2) (PingResponseV2, error)
}
ServiceV2 contains only V2 Unary methods. It is separate from the V1 Service interface.
type StreamReaderV2 ¶
StreamReaderV2 is a receive-only view returned by generated Server Stream local openers.
func OpenTailLocalV2 ¶
func OpenTailLocalV2(ctx context.Context, cursor string, cfg contract.StreamConfig, svc StreamingServiceV2) (StreamReaderV2[TailResponseV2], error)
OpenTailLocalV2 opens a typed local Server Stream; cursor remains application-owned.
func OpenWatchLocalV2 ¶
func OpenWatchLocalV2(ctx context.Context, cursor string, cfg contract.StreamConfig, svc StreamingServiceV2, req WatchRequestV2) (StreamReaderV2[WatchResponseV2], error)
OpenWatchLocalV2 opens a typed local Server Stream; cursor remains application-owned.
type StreamSenderV2 ¶
StreamSenderV2 sends one ordered response message. A full local queue applies backpressure.
type StreamingServiceV2 ¶
type StreamingServiceV2 interface {
// Watch sends ordered response events. cursor is the opaque application cursor from Last-Event-ID.
Watch(ctx context.Context, cursor string, req WatchRequestV2, sender StreamSenderV2[WatchResponseV2]) error
// Tail sends ordered response events. cursor is the opaque application cursor from Last-Event-ID.
Tail(ctx context.Context, cursor string, sender StreamSenderV2[TailResponseV2]) error
// Chat exchanges ordered peer messages.
Chat(ctx context.Context, stream contract.Stream[ChatResponseV2, ChatRequestV2]) error
}
StreamingServiceV2 contains V2 stream producers. Server Stream request is received once; Bidi Stream uses request and response as peer message types.
type TailResponseV2 ¶
type TailResponseV2 struct {
// Sequence 必填。
Sequence string `json:"sequence"`
}
TailResponseV2 Tail V2 response message DTO.
type WatchRequestV2 ¶
type WatchRequestV2 struct {
// Topic 必填。
Topic string `json:"topic"`
}
WatchRequestV2 Watch V2 request DTO.
type WatchResponseV2 ¶
type WatchResponseV2 struct {
EventID string `json:"event_id"`
Event string `json:"event"`
Meta EventMetaV2 `json:"meta"`
}
WatchResponseV2 Watch V2 response message DTO.