fixturev2

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 12 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 DialChatWebSocketV2

DialChatWebSocketV2 opens the secure remote Bidi Stream for /v2/chat.

func DialTailSSEV2 added in v0.10.0

DialTailSSEV2 opens the secure remote receive-only Server Stream for /v2/tail. cfg.LastEventID is the application-owned resume cursor; this client does not reconnect or replay.

func DialWatchSSEV2 added in v0.10.0

DialWatchSSEV2 opens the secure remote receive-only Server Stream for /v2/watch. cfg.LastEventID is the application-owned resume cursor; this client does not reconnect or replay.

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

func NewHTTPHandlerV2(svc ServiceV2) http.Handler

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

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 NewSecureClientV2

func NewSecureClientV2(base string, opts contract.SecureClientOptions) (*ClientV2, error)

NewSecureClientV2 creates the authenticated HTTPS client for V2 Unary methods.

func (*ClientV2) Ping

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.

func WrapServiceV2

func WrapServiceV2(inner ServiceV2, timeout time.Duration) ServiceV2

WrapServiceV2 applies the standard contract boundary; timeout <= 0 uses the framework default.

type StreamReaderV2

type StreamReaderV2[T any] interface{ contract.ServerStream[T] }

StreamReaderV2 preserves the generated receive-only API and shares the contract Server Stream capability.

func OpenTailLocalV2

OpenTailLocalV2 opens a typed local Server Stream; cursor remains application-owned.

func OpenWatchLocalV2

OpenWatchLocalV2 opens a typed local Server Stream; cursor remains application-owned.

type StreamSenderV2

type StreamSenderV2[T any] interface {
	Send(context.Context, T) error
}

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.

Jump to

Keyboard shortcuts

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