generic

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BinaryThriftGenericV1PayloadCodecKey is used to be compatible with old binary thrift generic to get the payload codec.
	BinaryThriftGenericV1PayloadCodecKey = "binary_thrift_generic_v1_payload_codec"
	// GetMethodNameByRequestFuncKey is used to get method name by request for http generic.
	GetMethodNameByRequestFuncKey = "get_method_name_by_request_func"
	// IsBinaryGeneric is used to judge whether it is binary generic, except BinaryThriftGeneric.
	IsBinaryGeneric = "is_binary_generic"
)

Variables

This section is empty.

Functions

func GetGenericStreamingMode added in v0.15.0

func GetGenericStreamingMode(ctx context.Context) serviceinfo.StreamingMode

GetGenericStreamingMode gets the generic streaming mode from the context.

func WithGenericStreamingMode added in v0.15.0

func WithGenericStreamingMode(ctx context.Context, sm serviceinfo.StreamingMode) context.Context

WithGenericStreamingMode sets the generic streaming mode to the context. It provides stream mode information for the ServiceInfo.MethodInfo() lookup interface to obtain the correct MethodInfo in binary generic scenarios.

Types

type Args

type Args struct {
	Request interface{}
	Method  string
	// contains filtered or unexported fields
}

Args generic request

func (*Args) GetFirstArgument

func (g *Args) GetFirstArgument() interface{}

GetFirstArgument implements util.KitexArgs.

func (*Args) GetOrSetBase

func (g *Args) GetOrSetBase() interface{}

func (*Args) Read

func (g *Args) Read(ctx context.Context, method string, dataLen int, in bufiox.Reader) error

Read ...

func (*Args) ReadPb

func (g *Args) ReadPb(ctx context.Context, method string, in []byte) error

func (*Args) SetCodec

func (g *Args) SetCodec(inner interface{})

func (*Args) Write

func (g *Args) Write(ctx context.Context, method string, out bufiox.Writer) error

Write ...

func (*Args) WritePb

func (g *Args) WritePb(ctx context.Context, method string) (interface{}, error)

type Result

type Result struct {
	Success interface{}
	// contains filtered or unexported fields
}

Result generic response

func (*Result) GetResult

func (r *Result) GetResult() interface{}

GetResult ...

func (*Result) GetSuccess

func (r *Result) GetSuccess() interface{}

GetSuccess implements util.KitexResult.

func (*Result) IsSetSuccess

func (r *Result) IsSetSuccess() bool

IsSetSuccess ...

func (*Result) Read

func (r *Result) Read(ctx context.Context, method string, dataLen int, in bufiox.Reader) error

Read ...

func (*Result) ReadPb

func (r *Result) ReadPb(ctx context.Context, method string, in []byte) error

func (*Result) SetCodec

func (r *Result) SetCodec(inner interface{})

SetCodec ...

func (*Result) SetSuccess

func (r *Result) SetSuccess(x interface{})

SetSuccess implements util.KitexResult.

func (*Result) Write

func (r *Result) Write(ctx context.Context, method string, out bufiox.Writer) error

Write ...

func (*Result) WritePb

func (r *Result) WritePb(ctx context.Context, method string) (interface{}, error)

type ThriftReader

type ThriftReader interface {
	Read(ctx context.Context, method string, dataLen int, r bufiox.Reader) error
}

type ThriftWriter

type ThriftWriter interface {
	Write(ctx context.Context, method string, w bufiox.Writer) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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