transport

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 123

Documentation

Index

Constants

View Source
const ServiceInfoContextKey = serviceInfoContextKey(0)

ServiceInfoContextKey .

Variables

This section is empty.

Functions

func GetFullMethodName

func GetFullMethodName(ctx context.Context) string

GetFullMethodName .

func WithHTTPHeaderForServer

func WithHTTPHeaderForServer(ctx context.Context, header http.Header) context.Context

WithHTTPHeaderForServer setup header for http server

func WithHeader

func WithHeader(ctx context.Context, header Header) context.Context

WithHeader setup header for caller

func WithServiceInfo

func WithServiceInfo(ctx context.Context, info ServiceInfo) context.Context

WithServiceInfo .

Types

type Header = metadata.MD

Header .

func ContextHeader

func ContextHeader(ctx context.Context) Header

ContextHeader get header in server

type Register

type Register interface {
	transhttp.Router
	transgrpc.ServiceRegistrar
}

Register .

type ServiceInfo

type ServiceInfo interface {
	Service() string
	Method() string
	Instance() interface{}
}

ServiceInfo .

func ContextServiceInfo

func ContextServiceInfo(ctx context.Context) ServiceInfo

ContextServiceInfo .

func NewServiceInfo

func NewServiceInfo(service string, method string, instance interface{}) ServiceInfo

NewServiceInfo .

type ServiceOption

type ServiceOption func(*ServiceOptions)

ServiceOption .

func WithHTTPOptions

func WithHTTPOptions(o ...transhttp.HandleOption) ServiceOption

WithHTTPOptions .

func WithInterceptors

func WithInterceptors(o ...interceptor.Interceptor) ServiceOption

WithInterceptors .

type ServiceOptions

type ServiceOptions struct {
	HTTP []transhttp.HandleOption
	GRPC []transgrpc.HandleOption
}

ServiceOptions .

func DefaultServiceOptions

func DefaultServiceOptions() *ServiceOptions

DefaultServiceOptions .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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