Documentation
¶
Overview ¶
Package service contains generated code by adptool.
Package service implements the functions, types, and interfaces for the module.
Index ¶
- Constants
- Variables
- func AddressGRPC(addr string) transgrpc.ServerOption
- func AddressHTTP(addr string) transhttp.ServerOption
- func CodecForRequestHTTP(r *http.Request, name string) (encoding.Codec, bool)
- func CodecForResponseHTTP(r *http.Response) encoding.Codec
- func ContentTypeHTTP(contentType string) transhttp.CallOption
- func CustomHealthGRPC() transgrpc.ServerOption
- func DefaultErrorDecoderHTTP(p0 context.Context, res *http.Response) error
- func DefaultErrorEncoderHTTP(w http.ResponseWriter, r *http.Request, err error)
- func DefaultRequestDecoderHTTP(r *http.Request, v any) error
- func DefaultRequestEncoderHTTP(p0 context.Context, contentType string, in any) ([]byte, error)
- func DefaultRequestQueryHTTP(r *http.Request, v any) error
- func DefaultRequestVarsHTTP(r *http.Request, v any) error
- func DefaultResponseDecoderHTTP(p0 context.Context, res *http.Response, v any) error
- func DefaultResponseEncoderHTTP(w http.ResponseWriter, r *http.Request, v any) error
- func DialGRPC(ctx context.Context, opts ...transgrpc.ClientOption) (*grpc.ClientConn, error)
- func DialInsecureGRPC(ctx context.Context, opts ...transgrpc.ClientOption) (*grpc.ClientConn, error)
- func DisableReflectionGRPC() transgrpc.ServerOption
- func EndpointGRPC(endpoint *url.URL) transgrpc.ServerOption
- func EndpointHTTP(endpoint *url.URL) transhttp.ServerOption
- func ErrorEncoderHTTP(en transhttp.EncodeErrorFunc) transhttp.ServerOption
- func FilterChainHTTP(filters ...transhttp.FilterFunc) transhttp.FilterFunc
- func FilterHTTP(filters ...transhttp.FilterFunc) transhttp.ServerOption
- func GetStreamGRPC(ctx context.Context) grpc.ServerStream
- func HeaderHTTP(header *http.Header) transhttp.CallOption
- func ListenerGRPC(lis net.Listener) transgrpc.ServerOption
- func ListenerHTTP(lis net.Listener) transhttp.ServerOption
- func LoggerGRPC(p0 log.Logger) transgrpc.ServerOption
- func LoggerHTTP(p0 log.Logger) transhttp.ServerOption
- func MethodNotAllowedHandlerHTTP(handler http.Handler) transhttp.ServerOption
- func MiddlewareGRPC(m ...middleware.Middleware) transgrpc.ServerOption
- func MiddlewareHTTP(m ...middleware.Middleware) transhttp.ServerOption
- func NetworkGRPC(network string) transgrpc.ServerOption
- func NetworkHTTP(network string) transhttp.ServerOption
- func NewClient(ctx context.Context, cfg *transportv1.Client, opts ...options.Option) (interfaces.Client, error)
- func NewClientHTTP(ctx context.Context, opts ...transhttp.ClientOption) (*transhttp.Client, error)
- func NewRedirectHTTP(url string, code int) transhttp.Redirector
- func NewServer(cfg *transportv1.Server, opts ...options.Option) (interfaces.Server, error)
- func NewServerGRPC(opts ...transgrpc.ServerOption) *transgrpc.Server
- func NewServerHTTP(opts ...transhttp.ServerOption) *transhttp.Server
- func NotFoundHandlerHTTP(handler http.Handler) transhttp.ServerOption
- func OperationHTTP(operation string) transhttp.CallOption
- func OptionsGRPC(opts ...grpc.ServerOption) transgrpc.ServerOption
- func PathPrefixHTTP(prefix string) transhttp.ServerOption
- func PathTemplateHTTP(pattern string) transhttp.CallOption
- func RegisterProtocol(name string, f ProtocolFactory)
- func RequestDecoderHTTP(dec transhttp.DecodeRequestFunc) transhttp.ServerOption
- func RequestFromServerContextHTTP(ctx context.Context) (*http.Request, bool)
- func RequestQueryDecoderHTTP(dec transhttp.DecodeRequestFunc) transhttp.ServerOption
- func RequestVarsDecoderHTTP(dec transhttp.DecodeRequestFunc) transhttp.ServerOption
- func ResponseEncoderHTTP(en transhttp.EncodeResponseFunc) transhttp.ServerOption
- func SetCookieHTTP(ctx context.Context, cookie *http.Cookie)
- func SetOperationHTTP(ctx context.Context, op string)
- func StreamInterceptorGRPC(in ...grpc.StreamServerInterceptor) transgrpc.ServerOption
- func StreamMiddlewareGRPC(m ...middleware.Middleware) transgrpc.ServerOption
- func StrictSlashHTTP(strictSlash bool) transhttp.ServerOption
- func TLSConfigGRPC(c *tls.Config) transgrpc.ServerOption
- func TLSConfigHTTP(c *tls.Config) transhttp.ServerOption
- func TimeoutGRPC(timeout time.Duration) transgrpc.ServerOption
- func TimeoutHTTP(timeout time.Duration) transhttp.ServerOption
- func UnaryInterceptorGRPC(in ...grpc.UnaryServerInterceptor) transgrpc.ServerOption
- func WithBlockHTTP() transhttp.ClientOption
- func WithContainer(c interfaces.Container) options.Option
- func WithDiscoveryGRPC(d registry.Discovery) transgrpc.ClientOption
- func WithDiscoveryHTTP(d registry.Discovery) transhttp.ClientOption
- func WithEndpointGRPC(endpoint string) transgrpc.ClientOption
- func WithEndpointHTTP(endpoint string) transhttp.ClientOption
- func WithErrorDecoderHTTP(errorDecoder transhttp.DecodeErrorFunc) transhttp.ClientOption
- func WithHealthCheckGRPC(healthCheck bool) transgrpc.ClientOption
- func WithLoggerGRPC(p0 log.Logger) transgrpc.ClientOption
- func WithMiddlewareGRPC(m ...middleware.Middleware) transgrpc.ClientOption
- func WithMiddlewareHTTP(m ...middleware.Middleware) transhttp.ClientOption
- func WithNodeFilterGRPC(filters ...selector.NodeFilter) transgrpc.ClientOption
- func WithNodeFilterHTTP(filters ...selector.NodeFilter) transhttp.ClientOption
- func WithOptionsGRPC(opts ...grpc.DialOption) transgrpc.ClientOption
- func WithPrintDiscoveryDebugLogGRPC(p bool) transgrpc.ClientOption
- func WithRegistrar(r ServerRegistrar) options.Option
- func WithRequestEncoderHTTP(encoder transhttp.EncodeRequestFunc) transhttp.ClientOption
- func WithResponseDecoderHTTP(decoder transhttp.DecodeResponseFunc) transhttp.ClientOption
- func WithStreamInterceptorGRPC(in ...grpc.StreamClientInterceptor) transgrpc.ClientOption
- func WithSubsetGRPC(size int) transgrpc.ClientOption
- func WithSubsetHTTP(size int) transhttp.ClientOption
- func WithTLSConfigGRPC(c *tls.Config) transgrpc.ClientOption
- func WithTLSConfigHTTP(c *tls.Config) transhttp.ClientOption
- func WithTimeoutGRPC(timeout time.Duration) transgrpc.ClientOption
- func WithTimeoutHTTP(d time.Duration) transhttp.ClientOption
- func WithTransportHTTP(trans http.RoundTripper) transhttp.ClientOption
- func WithUnaryInterceptorGRPC(in ...grpc.UnaryClientInterceptor) transgrpc.ClientOption
- func WithUserAgentHTTP(ua string) transhttp.ClientOption
- type CallOptionHTTP
- type ClientHTTP
- type ClientOptionGRPC
- type ClientOptionHTTP
- type ContentTypeCallOptionHTTP
- type ContextHTTP
- type DecodeErrorFuncHTTP
- type DecodeRequestFuncHTTP
- type DecodeResponseFuncHTTP
- type EmptyCallOptionHTTP
- type EncodeErrorFuncHTTP
- type EncodeRequestFuncHTTP
- type EncodeResponseFuncHTTP
- type FilterFuncHTTP
- type FlusherHTTP
- type GRPCClient
- type GRPCClientOption
- type GRPCRegisterFunc
- type GRPCRegistrar
- type GRPCServer
- type GRPCServerOption
- type HTTPClient
- type HTTPClientOption
- type HTTPRegisterFunc
- type HTTPRegistrar
- type HTTPServer
- type HTTPServerOption
- type HandlerFuncHTTP
- type HeaderCallOptionHTTP
- type OperationCallOptionHTTP
- type Options
- type PathTemplateCallOptionHTTP
- type ProtocolFactory
- type RedirectorHTTP
- type RequestHTTP
- type ResponseControllerHTTP
- type ResponseWriterHTTP
- type RouteInfoHTTP
- type RouterHTTP
- type ServerGRPC
- type ServerHTTP
- type ServerOptionGRPC
- type ServerOptionHTTP
- type ServerRegisterFunc
- type ServerRegistrar
- type TargetHTTP
- type TrailerGRPC
- type TransportGRPC
- type TransportHTTP
- type TransporterHTTP
- type WalkRouteFuncHTTP
Constants ¶
const ( ProtocolGRPC = "grpc" ProtocolHTTP = "http" )
Protocol is the name of the gRPC, HTTP, or other protocol.
const DefaultTimeout = 5 * time.Second
const SupportPackageIsVersion1 = transhttp.SupportPackageIsVersion1
Variables ¶
var ( ErrNilServerConfig = newServiceError("server configuration is nil") ErrMissingServerConfig = newServiceError("missing server configuration") ErrNilClientConfig = newServiceError("client configuration is nil") ErrMissingClientConfig = newServiceError("missing client configuration") ErrMissingProtocol = newServiceError("protocol is not specified") ErrUnsupportedProtocol = newServiceError("unsupported protocol") )
Predefined errors using the common StructuredError
Functions ¶
func AddressGRPC ¶ added in v0.2.6
func AddressGRPC(addr string) transgrpc.ServerOption
func AddressHTTP ¶ added in v0.2.6
func AddressHTTP(addr string) transhttp.ServerOption
func CodecForRequestHTTP ¶ added in v0.2.6
func CodecForResponseHTTP ¶ added in v0.2.6
func ContentTypeHTTP ¶ added in v0.2.6
func ContentTypeHTTP(contentType string) transhttp.CallOption
func CustomHealthGRPC ¶ added in v0.2.6
func CustomHealthGRPC() transgrpc.ServerOption
func DefaultErrorDecoderHTTP ¶ added in v0.2.6
func DefaultErrorEncoderHTTP ¶ added in v0.2.6
func DefaultErrorEncoderHTTP(w http.ResponseWriter, r *http.Request, err error)
func DefaultRequestDecoderHTTP ¶ added in v0.2.6
func DefaultRequestEncoderHTTP ¶ added in v0.2.6
func DefaultRequestQueryHTTP ¶ added in v0.2.6
func DefaultRequestVarsHTTP ¶ added in v0.2.6
func DefaultResponseDecoderHTTP ¶ added in v0.2.6
func DefaultResponseEncoderHTTP ¶ added in v0.2.6
func DialGRPC ¶ added in v0.2.6
func DialGRPC(ctx context.Context, opts ...transgrpc.ClientOption) (*grpc.ClientConn, error)
func DialInsecureGRPC ¶ added in v0.2.6
func DialInsecureGRPC(ctx context.Context, opts ...transgrpc.ClientOption) (*grpc.ClientConn, error)
func DisableReflectionGRPC ¶ added in v0.2.6
func DisableReflectionGRPC() transgrpc.ServerOption
func EndpointGRPC ¶ added in v0.2.6
func EndpointGRPC(endpoint *url.URL) transgrpc.ServerOption
func EndpointHTTP ¶ added in v0.2.6
func EndpointHTTP(endpoint *url.URL) transhttp.ServerOption
func ErrorEncoderHTTP ¶ added in v0.2.6
func ErrorEncoderHTTP(en transhttp.EncodeErrorFunc) transhttp.ServerOption
func FilterChainHTTP ¶ added in v0.2.6
func FilterChainHTTP(filters ...transhttp.FilterFunc) transhttp.FilterFunc
func FilterHTTP ¶ added in v0.2.6
func FilterHTTP(filters ...transhttp.FilterFunc) transhttp.ServerOption
func GetStreamGRPC ¶ added in v0.2.6
func GetStreamGRPC(ctx context.Context) grpc.ServerStream
func HeaderHTTP ¶ added in v0.2.6
func HeaderHTTP(header *http.Header) transhttp.CallOption
func ListenerGRPC ¶ added in v0.2.6
func ListenerGRPC(lis net.Listener) transgrpc.ServerOption
func ListenerHTTP ¶ added in v0.2.6
func ListenerHTTP(lis net.Listener) transhttp.ServerOption
func LoggerGRPC ¶ added in v0.2.6
func LoggerGRPC(p0 log.Logger) transgrpc.ServerOption
func LoggerHTTP ¶ added in v0.2.6
func LoggerHTTP(p0 log.Logger) transhttp.ServerOption
func MethodNotAllowedHandlerHTTP ¶ added in v0.2.6
func MethodNotAllowedHandlerHTTP(handler http.Handler) transhttp.ServerOption
func MiddlewareGRPC ¶ added in v0.2.6
func MiddlewareGRPC(m ...middleware.Middleware) transgrpc.ServerOption
func MiddlewareHTTP ¶ added in v0.2.6
func MiddlewareHTTP(m ...middleware.Middleware) transhttp.ServerOption
func NetworkGRPC ¶ added in v0.2.6
func NetworkGRPC(network string) transgrpc.ServerOption
func NetworkHTTP ¶ added in v0.2.6
func NetworkHTTP(network string) transhttp.ServerOption
func NewClient ¶ added in v0.2.6
func NewClient(ctx context.Context, cfg *transportv1.Client, opts ...options.Option) (interfaces.Client, error)
NewClient creates a new client instance based on the provided configuration and options.
func NewClientHTTP ¶ added in v0.2.6
func NewRedirectHTTP ¶ added in v0.2.6
func NewRedirectHTTP(url string, code int) transhttp.Redirector
func NewServer ¶ added in v0.2.6
func NewServer(cfg *transportv1.Server, opts ...options.Option) (interfaces.Server, error)
NewServer creates a new server instance based on the provided configuration and options. It automatically looks up the appropriate protocol factory from the default registry.
func NewServerGRPC ¶ added in v0.2.6
func NewServerGRPC(opts ...transgrpc.ServerOption) *transgrpc.Server
func NewServerHTTP ¶ added in v0.2.6
func NewServerHTTP(opts ...transhttp.ServerOption) *transhttp.Server
func NotFoundHandlerHTTP ¶ added in v0.2.6
func NotFoundHandlerHTTP(handler http.Handler) transhttp.ServerOption
func OperationHTTP ¶ added in v0.2.6
func OperationHTTP(operation string) transhttp.CallOption
func OptionsGRPC ¶ added in v0.2.6
func OptionsGRPC(opts ...grpc.ServerOption) transgrpc.ServerOption
func PathPrefixHTTP ¶ added in v0.2.6
func PathPrefixHTTP(prefix string) transhttp.ServerOption
func PathTemplateHTTP ¶ added in v0.2.6
func PathTemplateHTTP(pattern string) transhttp.CallOption
func RegisterProtocol ¶ added in v0.2.6
func RegisterProtocol(name string, f ProtocolFactory)
RegisterProtocol registers a new protocol factory with the default registry. This function is the public API for registration and is safe for concurrent use.
func RequestDecoderHTTP ¶ added in v0.2.6
func RequestDecoderHTTP(dec transhttp.DecodeRequestFunc) transhttp.ServerOption
func RequestFromServerContextHTTP ¶ added in v0.2.6
func RequestQueryDecoderHTTP ¶ added in v0.2.6
func RequestQueryDecoderHTTP(dec transhttp.DecodeRequestFunc) transhttp.ServerOption
func RequestVarsDecoderHTTP ¶ added in v0.2.6
func RequestVarsDecoderHTTP(dec transhttp.DecodeRequestFunc) transhttp.ServerOption
func ResponseEncoderHTTP ¶ added in v0.2.6
func ResponseEncoderHTTP(en transhttp.EncodeResponseFunc) transhttp.ServerOption
func SetOperationHTTP ¶ added in v0.2.6
func StreamInterceptorGRPC ¶ added in v0.2.6
func StreamInterceptorGRPC(in ...grpc.StreamServerInterceptor) transgrpc.ServerOption
func StreamMiddlewareGRPC ¶ added in v0.2.6
func StreamMiddlewareGRPC(m ...middleware.Middleware) transgrpc.ServerOption
func StrictSlashHTTP ¶ added in v0.2.6
func StrictSlashHTTP(strictSlash bool) transhttp.ServerOption
func TLSConfigGRPC ¶ added in v0.2.6
func TLSConfigGRPC(c *tls.Config) transgrpc.ServerOption
func TLSConfigHTTP ¶ added in v0.2.6
func TLSConfigHTTP(c *tls.Config) transhttp.ServerOption
func TimeoutGRPC ¶ added in v0.2.6
func TimeoutGRPC(timeout time.Duration) transgrpc.ServerOption
func TimeoutHTTP ¶ added in v0.2.6
func TimeoutHTTP(timeout time.Duration) transhttp.ServerOption
func UnaryInterceptorGRPC ¶ added in v0.2.6
func UnaryInterceptorGRPC(in ...grpc.UnaryServerInterceptor) transgrpc.ServerOption
func WithBlockHTTP ¶ added in v0.2.6
func WithBlockHTTP() transhttp.ClientOption
func WithContainer ¶ added in v0.2.6
func WithContainer(c interfaces.Container) options.Option
WithContainer sets the application component container.
func WithDiscoveryGRPC ¶ added in v0.2.6
func WithDiscoveryGRPC(d registry.Discovery) transgrpc.ClientOption
func WithDiscoveryHTTP ¶ added in v0.2.6
func WithDiscoveryHTTP(d registry.Discovery) transhttp.ClientOption
func WithEndpointGRPC ¶ added in v0.2.6
func WithEndpointGRPC(endpoint string) transgrpc.ClientOption
func WithEndpointHTTP ¶ added in v0.2.6
func WithEndpointHTTP(endpoint string) transhttp.ClientOption
func WithErrorDecoderHTTP ¶ added in v0.2.6
func WithErrorDecoderHTTP(errorDecoder transhttp.DecodeErrorFunc) transhttp.ClientOption
func WithHealthCheckGRPC ¶ added in v0.2.6
func WithHealthCheckGRPC(healthCheck bool) transgrpc.ClientOption
func WithLoggerGRPC ¶ added in v0.2.6
func WithLoggerGRPC(p0 log.Logger) transgrpc.ClientOption
func WithMiddlewareGRPC ¶ added in v0.2.6
func WithMiddlewareGRPC(m ...middleware.Middleware) transgrpc.ClientOption
func WithMiddlewareHTTP ¶ added in v0.2.6
func WithMiddlewareHTTP(m ...middleware.Middleware) transhttp.ClientOption
func WithNodeFilterGRPC ¶ added in v0.2.6
func WithNodeFilterGRPC(filters ...selector.NodeFilter) transgrpc.ClientOption
func WithNodeFilterHTTP ¶ added in v0.2.6
func WithNodeFilterHTTP(filters ...selector.NodeFilter) transhttp.ClientOption
func WithOptionsGRPC ¶ added in v0.2.6
func WithOptionsGRPC(opts ...grpc.DialOption) transgrpc.ClientOption
func WithPrintDiscoveryDebugLogGRPC ¶ added in v0.2.6
func WithPrintDiscoveryDebugLogGRPC(p bool) transgrpc.ClientOption
func WithRegistrar ¶ added in v0.2.6
func WithRegistrar(r ServerRegistrar) options.Option
WithRegistrar sets the ServerRegistrar for the service.
func WithRequestEncoderHTTP ¶ added in v0.2.6
func WithRequestEncoderHTTP(encoder transhttp.EncodeRequestFunc) transhttp.ClientOption
func WithResponseDecoderHTTP ¶ added in v0.2.6
func WithResponseDecoderHTTP(decoder transhttp.DecodeResponseFunc) transhttp.ClientOption
func WithStreamInterceptorGRPC ¶ added in v0.2.6
func WithStreamInterceptorGRPC(in ...grpc.StreamClientInterceptor) transgrpc.ClientOption
func WithSubsetGRPC ¶ added in v0.2.6
func WithSubsetGRPC(size int) transgrpc.ClientOption
func WithSubsetHTTP ¶ added in v0.2.6
func WithSubsetHTTP(size int) transhttp.ClientOption
func WithTLSConfigGRPC ¶ added in v0.2.6
func WithTLSConfigGRPC(c *tls.Config) transgrpc.ClientOption
func WithTLSConfigHTTP ¶ added in v0.2.6
func WithTLSConfigHTTP(c *tls.Config) transhttp.ClientOption
func WithTimeoutGRPC ¶ added in v0.2.6
func WithTimeoutGRPC(timeout time.Duration) transgrpc.ClientOption
func WithTimeoutHTTP ¶ added in v0.2.6
func WithTimeoutHTTP(d time.Duration) transhttp.ClientOption
func WithTransportHTTP ¶ added in v0.2.6
func WithTransportHTTP(trans http.RoundTripper) transhttp.ClientOption
func WithUnaryInterceptorGRPC ¶ added in v0.2.6
func WithUnaryInterceptorGRPC(in ...grpc.UnaryClientInterceptor) transgrpc.ClientOption
func WithUserAgentHTTP ¶ added in v0.2.6
func WithUserAgentHTTP(ua string) transhttp.ClientOption
Types ¶
type CallOptionHTTP ¶ added in v0.2.6
type CallOptionHTTP = transhttp.CallOption
type ClientHTTP ¶ added in v0.2.6
type ClientOptionGRPC ¶ added in v0.2.6
type ClientOptionGRPC = transgrpc.ClientOption
type ClientOptionHTTP ¶ added in v0.2.6
type ClientOptionHTTP = transhttp.ClientOption
type ContentTypeCallOptionHTTP ¶ added in v0.2.6
type ContentTypeCallOptionHTTP = transhttp.ContentTypeCallOption
type ContextHTTP ¶ added in v0.2.6
type DecodeErrorFuncHTTP ¶ added in v0.2.6
type DecodeErrorFuncHTTP = transhttp.DecodeErrorFunc
type DecodeRequestFuncHTTP ¶ added in v0.2.6
type DecodeRequestFuncHTTP = transhttp.DecodeRequestFunc
type DecodeResponseFuncHTTP ¶ added in v0.2.6
type DecodeResponseFuncHTTP = transhttp.DecodeResponseFunc
type EmptyCallOptionHTTP ¶ added in v0.2.6
type EmptyCallOptionHTTP = transhttp.EmptyCallOption
type EncodeErrorFuncHTTP ¶ added in v0.2.6
type EncodeErrorFuncHTTP = transhttp.EncodeErrorFunc
type EncodeRequestFuncHTTP ¶ added in v0.2.6
type EncodeRequestFuncHTTP = transhttp.EncodeRequestFunc
type EncodeResponseFuncHTTP ¶ added in v0.2.6
type EncodeResponseFuncHTTP = transhttp.EncodeResponseFunc
type FilterFuncHTTP ¶ added in v0.2.6
type FilterFuncHTTP = transhttp.FilterFunc
type FlusherHTTP ¶ added in v0.2.6
type GRPCClientOption ¶ added in v0.0.4
type GRPCClientOption = transgrpc.ClientOption
GRPCClientOption define the gRPC client options
type GRPCRegisterFunc ¶ added in v0.2.6
type GRPCRegisterFunc func(ctx context.Context, srv *GRPCServer)
GRPCRegisterFunc is a function that implements GRPCRegistrar.
func (GRPCRegisterFunc) Register ¶ added in v0.2.6
func (f GRPCRegisterFunc) Register(ctx context.Context, srv any)
Register implements the ServerRegistrar interface for GRPCRegisterFunc.
func (GRPCRegisterFunc) RegisterGRPC ¶ added in v0.2.6
func (f GRPCRegisterFunc) RegisterGRPC(ctx context.Context, srv *GRPCServer)
RegisterGRPC implements the GRPCRegistrar interface for GRPCRegisterFunc.
type GRPCRegistrar ¶ added in v0.2.1
type GRPCRegistrar interface {
RegisterGRPC(ctx context.Context, srv *GRPCServer)
}
GRPCRegistrar is a capability interface for services that can register gRPC endpoints.
type GRPCServerOption ¶ added in v0.0.4
type GRPCServerOption = transgrpc.ServerOption
GRPCServerOption define the gRPC server options
type HTTPClientOption ¶ added in v0.0.4
type HTTPClientOption = transhttp.ClientOption
HTTPClientOption define the HTTP client options
type HTTPRegisterFunc ¶ added in v0.2.6
type HTTPRegisterFunc func(ctx context.Context, srv *HTTPServer)
HTTPRegisterFunc is a function that implements HTTPRegistrar.
func (HTTPRegisterFunc) Register ¶ added in v0.2.6
func (f HTTPRegisterFunc) Register(ctx context.Context, srv any)
Register implements the ServerRegistrar interface for HTTPRegisterFunc.
func (HTTPRegisterFunc) RegisterHTTP ¶ added in v0.2.6
func (f HTTPRegisterFunc) RegisterHTTP(ctx context.Context, srv *HTTPServer)
RegisterHTTP implements the HTTPRegistrar interface for HTTPRegisterFunc.
type HTTPRegistrar ¶ added in v0.2.1
type HTTPRegistrar interface {
RegisterHTTP(ctx context.Context, srv *HTTPServer)
}
HTTPRegistrar is a capability interface for services that can register HTTP endpoints.
type HTTPServerOption ¶ added in v0.0.4
type HTTPServerOption = transhttp.ServerOption
HTTPServerOption define the HTTP server options
type HandlerFuncHTTP ¶ added in v0.2.6
type HandlerFuncHTTP = transhttp.HandlerFunc
type HeaderCallOptionHTTP ¶ added in v0.2.6
type HeaderCallOptionHTTP = transhttp.HeaderCallOption
type OperationCallOptionHTTP ¶ added in v0.2.6
type OperationCallOptionHTTP = transhttp.OperationCallOption
type Options ¶ added in v0.2.0
type Options struct {
// Registrar is used to register server information with a service discovery registry.
Registrar ServerRegistrar
// Container provides access to various application components, including middleware.
Container interfaces.Container
}
Options is a container for all service-level options. It is configured via the options pattern and is intended to be used by transport factories. These options are typically provided during application bootstrap.
func FromOptions ¶ added in v0.2.6
FromOptions creates a new Options struct by applying a slice of functional options.
type PathTemplateCallOptionHTTP ¶ added in v0.2.6
type PathTemplateCallOptionHTTP = transhttp.PathTemplateCallOption
type ProtocolFactory ¶ added in v0.2.6
type ProtocolFactory interface {
NewServer(cfg *transportv1.Server, opts ...options.Option) (interfaces.Server, error)
NewClient(ctx context.Context, cfg *transportv1.Client, opts ...options.Option) (interfaces.Client, error)
}
ProtocolFactory defines the factory standard for creating a specific protocol service instance。
func GetProtocolFactory ¶ added in v0.2.6
func GetProtocolFactory(name string) (ProtocolFactory, bool)
GetProtocolFactory retrieves a registered protocol factory by name from the default registry. This function is the public API for retrieval.
type RedirectorHTTP ¶ added in v0.2.6
type RedirectorHTTP = transhttp.Redirector
type RequestHTTP ¶ added in v0.2.6
type ResponseControllerHTTP ¶ added in v0.2.6
type ResponseControllerHTTP = transhttp.ResponseController
type ResponseWriterHTTP ¶ added in v0.2.6
type ResponseWriterHTTP = transhttp.ResponseWriter
type RouteInfoHTTP ¶ added in v0.2.6
type RouterHTTP ¶ added in v0.2.6
type ServerGRPC ¶ added in v0.2.6
type ServerHTTP ¶ added in v0.2.6
type ServerOptionGRPC ¶ added in v0.2.6
type ServerOptionGRPC = transgrpc.ServerOption
type ServerOptionHTTP ¶ added in v0.2.6
type ServerOptionHTTP = transhttp.ServerOption
type ServerRegisterFunc ¶ added in v0.2.6
ServerRegisterFunc is a function that implements ServerRegistrar.
type ServerRegistrar ¶ added in v0.2.1
ServerRegistrar defines the single, universal entry point for service registration. It is the responsibility of the transport-specific factories to pass the correct server type (e.g., *GRPCServer or *HTTPServer) to the Register method. The implementation of this interface, typically within the user's project, is expected to perform a type switch to handle the specific server type.
type TargetHTTP ¶ added in v0.2.6
type TrailerGRPC ¶ added in v0.2.6
type TransportGRPC ¶ added in v0.2.6
type TransportHTTP ¶ added in v0.2.6
type TransporterHTTP ¶ added in v0.2.6
type TransporterHTTP = transhttp.Transporter
type WalkRouteFuncHTTP ¶ added in v0.2.6
type WalkRouteFuncHTTP = transhttp.WalkRouteFunc
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package selector contains generated code by adptool.
|
Package selector contains generated code by adptool. |
|
Package tls implements the functions, types, and interfaces for the module.
|
Package tls implements the functions, types, and interfaces for the module. |
|
transport
|
|