streamxclient

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithStreamMiddleware

func WithStreamMiddleware(smw streamx.StreamMiddleware) internal_client.Option

WithStreamMiddleware currently is not open for users to use for now so it's include in internal package

Types

type CallOption

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

CallOption define stream call level option

func WithStreamCloseCallback

func WithStreamCloseCallback(callback StreamCloseCallback) CallOption

WithStreamCloseCallback register StreamCloseCallback

type CallOptions

type CallOptions struct {
	StreamCloseCallback []StreamCloseCallback
}

CallOptions define stream call level options

func GetCallOptionsFromCtx

func GetCallOptionsFromCtx(ctx context.Context) *CallOptions

GetCallOptionsFromCtx get CallOptions from context

func NewCtxWithCallOptions

func NewCtxWithCallOptions(ctx context.Context) (context.Context, *CallOptions)

NewCtxWithCallOptions register CallOptions into context

func (*CallOptions) Apply

func (copts *CallOptions) Apply(opts []CallOption)

Apply call options

type StreamCloseCallback

type StreamCloseCallback func(err error)

StreamCloseCallback define close callback of the stream

type StreamXClient

type StreamXClient interface {
	NewStream(ctx context.Context, method string, streamArgs streamx.StreamArgs, callOptions ...CallOption) (context.Context, streamx.ClientStream, error)
}

StreamXClient implement a streamx interface client

Jump to

Keyboard shortcuts

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