transport

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package service contains generated code by adptool.

Package transport implements the functions, types, and interfaces for the module.

Index

Constants

View Source
const DefaultTimeout = 5 * time.Second
View Source
const SupportPackageIsVersion1 = transhttp.SupportPackageIsVersion1

Variables

This section is empty.

Functions

func AddressGRPC

func AddressGRPC(addr string) transgrpc.ServerOption

func AddressHTTP

func AddressHTTP(addr string) transhttp.ServerOption

func CodecForRequestHTTP

func CodecForRequestHTTP(r *http.Request, name string) (encoding.Codec, bool)

func CodecForResponseHTTP

func CodecForResponseHTTP(r *http.Response) encoding.Codec

func ContentTypeHTTP

func ContentTypeHTTP(contentType string) transhttp.CallOption

func CustomHealthGRPC

func CustomHealthGRPC() transgrpc.ServerOption

func DefaultErrorDecoderHTTP

func DefaultErrorDecoderHTTP(p0 context.Context, res *http.Response) error

func DefaultErrorEncoderHTTP

func DefaultErrorEncoderHTTP(w http.ResponseWriter, r *http.Request, err error)

func DefaultRequestDecoderHTTP

func DefaultRequestDecoderHTTP(r *http.Request, v any) error

func DefaultRequestEncoderHTTP

func DefaultRequestEncoderHTTP(p0 context.Context, contentType string, in any) ([]byte, error)

func DefaultRequestQueryHTTP

func DefaultRequestQueryHTTP(r *http.Request, v any) error

func DefaultRequestVarsHTTP

func DefaultRequestVarsHTTP(r *http.Request, v any) error

func DefaultResponseDecoderHTTP

func DefaultResponseDecoderHTTP(p0 context.Context, res *http.Response, v any) error

func DefaultResponseEncoderHTTP

func DefaultResponseEncoderHTTP(w http.ResponseWriter, r *http.Request, v any) error

func DialGRPC

func DialGRPC(ctx context.Context, opts ...transgrpc.ClientOption) (*grpc.ClientConn, error)

func DialInsecureGRPC

func DialInsecureGRPC(ctx context.Context, opts ...transgrpc.ClientOption) (*grpc.ClientConn, error)

func DisableReflectionGRPC

func DisableReflectionGRPC() transgrpc.ServerOption

func EndpointGRPC

func EndpointGRPC(endpoint *url.URL) transgrpc.ServerOption

func EndpointHTTP

func EndpointHTTP(endpoint *url.URL) transhttp.ServerOption

func FilterChainHTTP

func FilterChainHTTP(filters ...transhttp.FilterFunc) transhttp.FilterFunc

func FilterHTTP

func FilterHTTP(filters ...transhttp.FilterFunc) transhttp.ServerOption

func GetStreamGRPC

func GetStreamGRPC(ctx context.Context) grpc.ServerStream

func HeaderHTTP

func HeaderHTTP(header *http.Header) transhttp.CallOption

func ListenerGRPC

func ListenerGRPC(lis net.Listener) transgrpc.ServerOption

func ListenerHTTP

func ListenerHTTP(lis net.Listener) transhttp.ServerOption

func LoggerGRPC

func LoggerGRPC(p0 log.Logger) transgrpc.ServerOption

func LoggerHTTP

func LoggerHTTP(p0 log.Logger) transhttp.ServerOption

func MethodNotAllowedHandlerHTTP

func MethodNotAllowedHandlerHTTP(handler http.Handler) transhttp.ServerOption

func MiddlewareGRPC

func MiddlewareGRPC(m ...middleware.Middleware) transgrpc.ServerOption

func MiddlewareHTTP

func MiddlewareHTTP(m ...middleware.Middleware) transhttp.ServerOption

func NetworkGRPC

func NetworkGRPC(network string) transgrpc.ServerOption

func NetworkHTTP

func NetworkHTTP(network string) transhttp.ServerOption

func NewClientHTTP

func NewClientHTTP(ctx context.Context, opts ...transhttp.ClientOption) (*transhttp.Client, error)

func NewRedirectHTTP

func NewRedirectHTTP(url string, code int) transhttp.Redirector

func NewServerGRPC

func NewServerGRPC(opts ...transgrpc.ServerOption) *transgrpc.Server

func NewServerHTTP

func NewServerHTTP(opts ...transhttp.ServerOption) *transhttp.Server

func NotFoundHandlerHTTP

func NotFoundHandlerHTTP(handler http.Handler) transhttp.ServerOption

func OperationHTTP

func OperationHTTP(operation string) transhttp.CallOption

func OptionsGRPC

func OptionsGRPC(opts ...grpc.ServerOption) transgrpc.ServerOption

func PathPrefixHTTP

func PathPrefixHTTP(prefix string) transhttp.ServerOption

func PathTemplateHTTP

func PathTemplateHTTP(pattern string) transhttp.CallOption

func RequestFromServerContextHTTP

func RequestFromServerContextHTTP(ctx context.Context) (*http.Request, bool)

func ResponseWriterFromServerContextHTTP

func ResponseWriterFromServerContextHTTP(ctx context.Context) (http.ResponseWriter, bool)

func SetCookieHTTP

func SetCookieHTTP(ctx context.Context, cookie *http.Cookie)

func SetOperationHTTP

func SetOperationHTTP(ctx context.Context, op string)

func StreamMiddlewareGRPC

func StreamMiddlewareGRPC(m ...middleware.Middleware) transgrpc.ServerOption

func StrictSlashHTTP

func StrictSlashHTTP(strictSlash bool) transhttp.ServerOption

func TLSConfigGRPC

func TLSConfigGRPC(c *tls.Config) transgrpc.ServerOption

func TLSConfigHTTP

func TLSConfigHTTP(c *tls.Config) transhttp.ServerOption

func TimeoutGRPC

func TimeoutGRPC(timeout time.Duration) transgrpc.ServerOption

func TimeoutHTTP

func TimeoutHTTP(timeout time.Duration) transhttp.ServerOption

func WithBlockHTTP

func WithBlockHTTP() transhttp.ClientOption

func WithDiscoveryGRPC

func WithDiscoveryGRPC(d registry.Discovery) transgrpc.ClientOption

func WithDiscoveryHTTP

func WithDiscoveryHTTP(d registry.Discovery) transhttp.ClientOption

func WithEndpointGRPC

func WithEndpointGRPC(endpoint string) transgrpc.ClientOption

func WithEndpointHTTP

func WithEndpointHTTP(endpoint string) transhttp.ClientOption

func WithErrorDecoderHTTP

func WithErrorDecoderHTTP(errorDecoder transhttp.DecodeErrorFunc) transhttp.ClientOption

func WithHealthCheckGRPC

func WithHealthCheckGRPC(healthCheck bool) transgrpc.ClientOption

func WithLoggerGRPC

func WithLoggerGRPC(p0 log.Logger) transgrpc.ClientOption

func WithMiddlewareGRPC

func WithMiddlewareGRPC(m ...middleware.Middleware) transgrpc.ClientOption

func WithMiddlewareHTTP

func WithMiddlewareHTTP(m ...middleware.Middleware) transhttp.ClientOption

func WithNodeFilterGRPC

func WithNodeFilterGRPC(filters ...selector.NodeFilter) transgrpc.ClientOption

func WithNodeFilterHTTP

func WithNodeFilterHTTP(filters ...selector.NodeFilter) transhttp.ClientOption

func WithOptionsGRPC

func WithOptionsGRPC(opts ...grpc.DialOption) transgrpc.ClientOption

func WithPrintDiscoveryDebugLogGRPC

func WithPrintDiscoveryDebugLogGRPC(p bool) transgrpc.ClientOption

func WithRequestEncoderHTTP

func WithRequestEncoderHTTP(encoder transhttp.EncodeRequestFunc) transhttp.ClientOption

func WithResponseDecoderHTTP

func WithResponseDecoderHTTP(decoder transhttp.DecodeResponseFunc) transhttp.ClientOption

func WithStreamInterceptorGRPC

func WithStreamInterceptorGRPC(in ...grpc.StreamClientInterceptor) transgrpc.ClientOption

func WithSubsetGRPC

func WithSubsetGRPC(size int) transgrpc.ClientOption

func WithSubsetHTTP

func WithSubsetHTTP(size int) transhttp.ClientOption

func WithTLSConfigGRPC

func WithTLSConfigGRPC(c *tls.Config) transgrpc.ClientOption

func WithTLSConfigHTTP

func WithTLSConfigHTTP(c *tls.Config) transhttp.ClientOption

func WithTimeoutGRPC

func WithTimeoutGRPC(timeout time.Duration) transgrpc.ClientOption

func WithTimeoutHTTP

func WithTimeoutHTTP(d time.Duration) transhttp.ClientOption

func WithTransportHTTP

func WithTransportHTTP(trans http.RoundTripper) transhttp.ClientOption

func WithUnaryInterceptorGRPC

func WithUnaryInterceptorGRPC(in ...grpc.UnaryClientInterceptor) transgrpc.ClientOption

func WithUserAgentHTTP

func WithUserAgentHTTP(ua string) transhttp.ClientOption

Types

type CallOptionHTTP

type CallOptionHTTP = transhttp.CallOption

type ClientHTTP

type ClientHTTP = transhttp.Client

type ClientOptionGRPC

type ClientOptionGRPC = transgrpc.ClientOption

type ClientOptionHTTP

type ClientOptionHTTP = transhttp.ClientOption

type ContentTypeCallOptionHTTP

type ContentTypeCallOptionHTTP = transhttp.ContentTypeCallOption

type ContextHTTP

type ContextHTTP = transhttp.Context

type DecodeErrorFuncHTTP

type DecodeErrorFuncHTTP = transhttp.DecodeErrorFunc

type DecodeRequestFuncHTTP

type DecodeRequestFuncHTTP = transhttp.DecodeRequestFunc

type DecodeResponseFuncHTTP

type DecodeResponseFuncHTTP = transhttp.DecodeResponseFunc

type EmptyCallOptionHTTP

type EmptyCallOptionHTTP = transhttp.EmptyCallOption

type EncodeErrorFuncHTTP

type EncodeErrorFuncHTTP = transhttp.EncodeErrorFunc

type EncodeRequestFuncHTTP

type EncodeRequestFuncHTTP = transhttp.EncodeRequestFunc

type EncodeResponseFuncHTTP

type EncodeResponseFuncHTTP = transhttp.EncodeResponseFunc

type FilterFuncHTTP

type FilterFuncHTTP = transhttp.FilterFunc

type FlusherHTTP

type FlusherHTTP = transhttp.Flusher

type GRPCClient

type GRPCClient = grpc.ClientConn

GRPCClient define the gRPC client interface

type GRPCClientOption

type GRPCClientOption = transgrpc.ClientOption

GRPCClientOption define the gRPC client options

type GRPCRegisterFunc

type GRPCRegisterFunc func(ctx context.Context, srv *GRPCServer) error

GRPCRegisterFunc is a function that implements GRPCRegistrar.

func (GRPCRegisterFunc) Register

func (f GRPCRegisterFunc) Register(ctx context.Context, srv any) error

Register implements the ServerRegistrar interface for GRPCRegisterFunc.

func (GRPCRegisterFunc) RegisterGRPC

func (f GRPCRegisterFunc) RegisterGRPC(ctx context.Context, srv *GRPCServer) error

RegisterGRPC implements the GRPCRegistrar interface for GRPCRegisterFunc.

type GRPCRegistrar

type GRPCRegistrar interface {
	RegisterGRPC(ctx context.Context, srv *GRPCServer) error
}

GRPCRegistrar is a capability interface for services that can register gRPC endpoints.

type GRPCServer

type GRPCServer = transgrpc.Server

GRPCServer define the gRPC server interface

type GRPCServerOption

type GRPCServerOption = transgrpc.ServerOption

GRPCServerOption define the gRPC server options

type HTTPClient

type HTTPClient = transhttp.Client

HTTPClient define the HTTP client interface

type HTTPClientOption

type HTTPClientOption = transhttp.ClientOption

HTTPClientOption define the HTTP client options

type HTTPRegisterFunc

type HTTPRegisterFunc func(ctx context.Context, srv *HTTPServer) error

HTTPRegisterFunc is a function that implements HTTPRegistrar.

func (HTTPRegisterFunc) Register

func (f HTTPRegisterFunc) Register(ctx context.Context, srv any) error

Register implements the ServerRegistrar interface for HTTPRegisterFunc.

func (HTTPRegisterFunc) RegisterHTTP

func (f HTTPRegisterFunc) RegisterHTTP(ctx context.Context, srv *HTTPServer) error

RegisterHTTP implements the HTTPRegistrar interface for HTTPRegisterFunc.

type HTTPRegistrar

type HTTPRegistrar interface {
	RegisterHTTP(ctx context.Context, srv *HTTPServer) error
}

HTTPRegistrar is a capability interface for services that can register HTTP endpoints.

type HTTPServer

type HTTPServer = transhttp.Server

HTTPServer define the HTTP server interface

type HTTPServerOption

type HTTPServerOption = transhttp.ServerOption

HTTPServerOption define the HTTP server options

type HandlerFuncHTTP

type HandlerFuncHTTP = transhttp.HandlerFunc

type HeaderCallOptionHTTP

type HeaderCallOptionHTTP = transhttp.HeaderCallOption

type OperationCallOptionHTTP

type OperationCallOptionHTTP = transhttp.OperationCallOption

type PathTemplateCallOptionHTTP

type PathTemplateCallOptionHTTP = transhttp.PathTemplateCallOption

type RedirectorHTTP

type RedirectorHTTP = transhttp.Redirector

type RequestHTTP

type RequestHTTP = transhttp.Request

type ResponseControllerHTTP

type ResponseControllerHTTP = transhttp.ResponseController

type ResponseTransporterHTTP

type ResponseTransporterHTTP = transhttp.ResponseTransporter

type ResponseWriterHTTP

type ResponseWriterHTTP = transhttp.ResponseWriter

type RouteInfoHTTP

type RouteInfoHTTP = transhttp.RouteInfo

type RouterHTTP

type RouterHTTP = transhttp.Router

type ServerGRPC

type ServerGRPC = transgrpc.Server

type ServerHTTP

type ServerHTTP = transhttp.Server

type ServerOptionGRPC

type ServerOptionGRPC = transgrpc.ServerOption

type ServerOptionHTTP

type ServerOptionHTTP = transhttp.ServerOption

type TargetHTTP

type TargetHTTP = transhttp.Target

type TrailerGRPC

type TrailerGRPC = transgrpc.Trailer

type TransportGRPC

type TransportGRPC = transgrpc.Transport

type TransportHTTP

type TransportHTTP = transhttp.Transport

type TransporterHTTP

type TransporterHTTP = transhttp.Transporter

type WalkRouteFuncHTTP

type WalkRouteFuncHTTP = transhttp.WalkRouteFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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