Documentation
¶
Index ¶
- Variables
- func ConnectError(err error) error
- func GRPCError(err error) error
- func RunPostRequestMappingInterfaceHooks[T any](ctx context.Context, info RPCInfo, value T, ...) (context.Context, error)
- func RunPostResponseMappingInterfaceHooks[T any](ctx context.Context, info RPCInfo, value T, ...) error
- func RunPreRequestMappingInterfaceHooks[T any](ctx context.Context, info RPCInfo, value T, ...) (context.Context, error)
- func RunPreResponseMappingInterfaceHooks[T any](ctx context.Context, info RPCInfo, value T, ...) error
- func WithConnectHandlerOptions(handlerOptions ...connect.HandlerOption) connectHandlerOptionsOption
- func WithErrorMapper(errorMapper ErrorMapper) errorMapperOption
- type ConnectAdapterOption
- type ConnectClientOption
- type ConnectHandlerOption
- type ErrorMapper
- type GRPCAdapterOption
- type GRPCClientOption
- type GRPCServerOption
- type InterfaceHooks
- func (ih *InterfaceHooks) AddPostRequestMappingHook[I any](hooks ...func(context.Context, RPCInfo, I) (context.Context, error))
- func (ih *InterfaceHooks) AddPostResponseMappingHook[I any](hooks ...func(context.Context, RPCInfo, I) error)
- func (ih *InterfaceHooks) AddPreRequestMappingHook[I any](hooks ...func(context.Context, RPCInfo, I) (context.Context, error))
- func (ih *InterfaceHooks) AddPreResponseMappingHook[I any](hooks ...func(context.Context, RPCInfo, I) error)
- func (ih *InterfaceHooks) SetPostRequestMappingHooks[I any](hooks ...func(context.Context, RPCInfo, I) (context.Context, error))
- func (ih *InterfaceHooks) SetPostResponseMappingHooks[I any](hooks ...func(context.Context, RPCInfo, I) error)
- func (ih *InterfaceHooks) SetPreRequestMappingHooks[I any](hooks ...func(context.Context, RPCInfo, I) (context.Context, error))
- func (ih *InterfaceHooks) SetPreResponseMappingHooks[I any](hooks ...func(context.Context, RPCInfo, I) error)
- type ListValue
- type PostRequestMappingInterfaceHookFunc
- type PostResponseMappingInterfaceHookFunc
- type PreRequestMappingInterfaceHookFunc
- type PreResponseMappingInterfaceHookFunc
- type RPCInfo
- type Struct
- type TransportOptions
- func NewConnectAdapterOptions(opts ...ConnectAdapterOption) TransportOptions
- func NewConnectClientOptions(opts ...ConnectClientOption) TransportOptions
- func NewConnectHandlerOptions(opts ...ConnectHandlerOption) TransportOptions
- func NewGRPCAdapterOptions(opts ...GRPCAdapterOption) TransportOptions
- func NewGRPCClientOptions(opts ...GRPCClientOption) TransportOptions
- func NewGRPCServerOptions(opts ...GRPCServerOption) TransportOptions
- type Value
Constants ¶
This section is empty.
Variables ¶
var ErrUnimplemented = errors.New("tego: unimplemented")
ErrUnimplemented marks a facade service method that has not been implemented.
Functions ¶
func ConnectError ¶
ConnectError maps Tego sentinel errors to native Connect errors.
func RunPostRequestMappingInterfaceHooks ¶
func RunPostRequestMappingInterfaceHooks[T any]( ctx context.Context, info RPCInfo, value T, hooks []PostRequestMappingInterfaceHookFunc, ) (context.Context, error)
RunPostRequestMappingInterfaceHooks runs matching after-request mapping interface hooks.
func RunPostResponseMappingInterfaceHooks ¶
func RunPostResponseMappingInterfaceHooks[T any]( ctx context.Context, info RPCInfo, value T, hooks []PostResponseMappingInterfaceHookFunc, ) error
RunPostResponseMappingInterfaceHooks runs matching after-response mapping interface hooks.
func RunPreRequestMappingInterfaceHooks ¶
func RunPreRequestMappingInterfaceHooks[T any]( ctx context.Context, info RPCInfo, value T, hooks []PreRequestMappingInterfaceHookFunc, ) (context.Context, error)
RunPreRequestMappingInterfaceHooks runs matching before-request mapping interface hooks.
func RunPreResponseMappingInterfaceHooks ¶
func RunPreResponseMappingInterfaceHooks[T any]( ctx context.Context, info RPCInfo, value T, hooks []PreResponseMappingInterfaceHookFunc, ) error
RunPreResponseMappingInterfaceHooks runs matching before-response mapping interface hooks.
func WithConnectHandlerOptions ¶
func WithConnectHandlerOptions(handlerOptions ...connect.HandlerOption) connectHandlerOptionsOption
WithConnectHandlerOptions passes native Connect handler options to generated Connect handlers.
func WithErrorMapper ¶
func WithErrorMapper(errorMapper ErrorMapper) errorMapperOption
WithErrorMapper configures generated transports to map boundary errors.
Types ¶
type ConnectAdapterOption ¶
type ConnectAdapterOption interface {
// contains filtered or unexported methods
}
ConnectAdapterOption configures a generated Connect adapter.
type ConnectClientOption ¶
type ConnectClientOption interface {
// contains filtered or unexported methods
}
ConnectClientOption configures a generated Connect client.
type ConnectHandlerOption ¶
type ConnectHandlerOption interface {
// contains filtered or unexported methods
}
ConnectHandlerOption configures a generated Connect handler.
type ErrorMapper ¶
ErrorMapper maps errors at generated transport boundaries.
type GRPCAdapterOption ¶
type GRPCAdapterOption interface {
// contains filtered or unexported methods
}
GRPCAdapterOption configures a generated gRPC adapter.
type GRPCClientOption ¶
type GRPCClientOption interface {
// contains filtered or unexported methods
}
GRPCClientOption configures a generated gRPC client.
type GRPCServerOption ¶
type GRPCServerOption interface {
// contains filtered or unexported methods
}
GRPCServerOption configures a generated gRPC server.
type InterfaceHooks ¶
type InterfaceHooks struct {
PreRequestMapping []PreRequestMappingInterfaceHookFunc
PostRequestMapping []PostRequestMappingInterfaceHookFunc
PreResponseMapping []PreResponseMappingInterfaceHookFunc
PostResponseMapping []PostResponseMappingInterfaceHookFunc
}
InterfaceHooks groups reusable hooks matched by Go interface implementation.
func MergeInterfaceHooks ¶
func MergeInterfaceHooks(hooks ...InterfaceHooks) InterfaceHooks
MergeInterfaceHooks appends matching hook slots from all hook groups.
func (*InterfaceHooks) AddPostRequestMappingHook ¶
func (ih *InterfaceHooks) AddPostRequestMappingHook[I any]( hooks ...func(context.Context, RPCInfo, I) (context.Context, error), )
AddPostRequestMappingHook appends hooks for Tego requests after request mapping.
func (*InterfaceHooks) AddPostResponseMappingHook ¶
func (ih *InterfaceHooks) AddPostResponseMappingHook[I any]( hooks ...func(context.Context, RPCInfo, I) error, )
AddPostResponseMappingHook appends hooks for protobuf responses after response mapping.
func (*InterfaceHooks) AddPreRequestMappingHook ¶
func (ih *InterfaceHooks) AddPreRequestMappingHook[I any]( hooks ...func(context.Context, RPCInfo, I) (context.Context, error), )
AddPreRequestMappingHook appends hooks for protobuf requests before request mapping.
func (*InterfaceHooks) AddPreResponseMappingHook ¶
func (ih *InterfaceHooks) AddPreResponseMappingHook[I any]( hooks ...func(context.Context, RPCInfo, I) error, )
AddPreResponseMappingHook appends hooks for Tego responses before response mapping.
func (*InterfaceHooks) SetPostRequestMappingHooks ¶
func (ih *InterfaceHooks) SetPostRequestMappingHooks[I any]( hooks ...func(context.Context, RPCInfo, I) (context.Context, error), )
SetPostRequestMappingHooks replaces hooks for Tego requests after request mapping.
func (*InterfaceHooks) SetPostResponseMappingHooks ¶
func (ih *InterfaceHooks) SetPostResponseMappingHooks[I any]( hooks ...func(context.Context, RPCInfo, I) error, )
SetPostResponseMappingHooks replaces hooks for protobuf responses after response mapping.
func (*InterfaceHooks) SetPreRequestMappingHooks ¶
func (ih *InterfaceHooks) SetPreRequestMappingHooks[I any]( hooks ...func(context.Context, RPCInfo, I) (context.Context, error), )
SetPreRequestMappingHooks replaces hooks for protobuf requests before request mapping.
func (*InterfaceHooks) SetPreResponseMappingHooks ¶
func (ih *InterfaceHooks) SetPreResponseMappingHooks[I any]( hooks ...func(context.Context, RPCInfo, I) error, )
SetPreResponseMappingHooks replaces hooks for Tego responses before response mapping.
type ListValue ¶
type ListValue = []Value
ListValue is the JSON-like list domain represented by google.protobuf.ListValue.
type PostRequestMappingInterfaceHookFunc ¶
type PostRequestMappingInterfaceHookFunc struct {
// contains filtered or unexported fields
}
PostRequestMappingInterfaceHookFunc applies to Tego requests after request mapping.
func PostRequestMappingAnyHook ¶
func PostRequestMappingAnyHook( hook func(context.Context, RPCInfo, any) (context.Context, error), ) PostRequestMappingInterfaceHookFunc
PostRequestMappingAnyHook adapts a hook that applies to every Tego request after request mapping.
func PostRequestMappingInterfaceHook ¶
func PostRequestMappingInterfaceHook[I any]( hook func(context.Context, RPCInfo, I) (context.Context, error), ) PostRequestMappingInterfaceHookFunc
PostRequestMappingInterfaceHook adapts a typed interface hook for Tego requests.
type PostResponseMappingInterfaceHookFunc ¶
type PostResponseMappingInterfaceHookFunc struct {
// contains filtered or unexported fields
}
PostResponseMappingInterfaceHookFunc applies to protobuf responses after response mapping.
func PostResponseMappingAnyHook ¶
func PostResponseMappingAnyHook( hook func(context.Context, RPCInfo, any) error, ) PostResponseMappingInterfaceHookFunc
PostResponseMappingAnyHook adapts a hook that applies to every protobuf response after response mapping.
func PostResponseMappingInterfaceHook ¶
func PostResponseMappingInterfaceHook[I any]( hook func(context.Context, RPCInfo, I) error, ) PostResponseMappingInterfaceHookFunc
PostResponseMappingInterfaceHook adapts a typed interface hook for protobuf responses.
type PreRequestMappingInterfaceHookFunc ¶
type PreRequestMappingInterfaceHookFunc struct {
// contains filtered or unexported fields
}
PreRequestMappingInterfaceHookFunc applies to protobuf requests before request mapping.
func PreRequestMappingAnyHook ¶
func PreRequestMappingAnyHook( hook func(context.Context, RPCInfo, any) (context.Context, error), ) PreRequestMappingInterfaceHookFunc
PreRequestMappingAnyHook adapts a hook that applies to every protobuf request before request mapping.
func PreRequestMappingInterfaceHook ¶
func PreRequestMappingInterfaceHook[I any]( hook func(context.Context, RPCInfo, I) (context.Context, error), ) PreRequestMappingInterfaceHookFunc
PreRequestMappingInterfaceHook adapts a typed interface hook for protobuf requests.
type PreResponseMappingInterfaceHookFunc ¶
type PreResponseMappingInterfaceHookFunc struct {
// contains filtered or unexported fields
}
PreResponseMappingInterfaceHookFunc applies to Tego responses before response mapping.
func PreResponseMappingAnyHook ¶
func PreResponseMappingAnyHook( hook func(context.Context, RPCInfo, any) error, ) PreResponseMappingInterfaceHookFunc
PreResponseMappingAnyHook adapts a hook that applies to every Tego response before response mapping.
func PreResponseMappingInterfaceHook ¶
func PreResponseMappingInterfaceHook[I any]( hook func(context.Context, RPCInfo, I) error, ) PreResponseMappingInterfaceHookFunc
PreResponseMappingInterfaceHook adapts a typed interface hook for Tego responses.
type TransportOptions ¶
type TransportOptions struct {
// contains filtered or unexported fields
}
TransportOptions contains resolved generated transport configuration.
func NewConnectAdapterOptions ¶
func NewConnectAdapterOptions(opts ...ConnectAdapterOption) TransportOptions
NewConnectAdapterOptions resolves generated Connect adapter options.
func NewConnectClientOptions ¶
func NewConnectClientOptions(opts ...ConnectClientOption) TransportOptions
NewConnectClientOptions resolves generated Connect client options.
func NewConnectHandlerOptions ¶
func NewConnectHandlerOptions(opts ...ConnectHandlerOption) TransportOptions
NewConnectHandlerOptions resolves generated Connect handler options.
func NewGRPCAdapterOptions ¶
func NewGRPCAdapterOptions(opts ...GRPCAdapterOption) TransportOptions
NewGRPCAdapterOptions resolves generated gRPC adapter options.
func NewGRPCClientOptions ¶
func NewGRPCClientOptions(opts ...GRPCClientOption) TransportOptions
NewGRPCClientOptions resolves generated gRPC client options.
func NewGRPCServerOptions ¶
func NewGRPCServerOptions(opts ...GRPCServerOption) TransportOptions
NewGRPCServerOptions resolves generated gRPC server options.
func (TransportOptions) ConnectHandlerOptions ¶
func (o TransportOptions) ConnectHandlerOptions() []connect.HandlerOption
ConnectHandlerOptions returns the configured native Connect handler options.
func (TransportOptions) ErrorMapper ¶
func (o TransportOptions) ErrorMapper(defaultMapper ErrorMapper) ErrorMapper
ErrorMapper returns the configured error mapper, or defaultMapper when none is configured.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
protoc-gen-tego
command
|
|
|
protoc-gen-tego-capture
command
|
|
|
examples
|
|
|
custom-types/custom
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
error-mapping/books
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
error-mapping/cmd/connect-client
command
|
|
|
error-mapping/cmd/connect-server
command
|
|
|
error-mapping/cmd/grpc-client
command
|
|
|
error-mapping/cmd/grpc-server
command
|
|
|
hooks/catalog
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
hooks/cmd/client
command
|
|
|
hooks/cmd/server
command
|
|
|
kitchen-sink/kitchensink
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
options/options
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
presence-patch/patch
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
quickstart-connect/cmd/client
command
|
|
|
quickstart-connect/cmd/server
command
|
|
|
quickstart-grpc/cmd/client
command
|
|
|
quickstart-grpc/cmd/server
command
|
|
|
quickstart/hello
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
shapes/shapes
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
streaming-grpc/cmd/client
command
|
|
|
streaming-grpc/cmd/server
command
|
|
|
streaming-grpc/streaming
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
transport-override/cmd/client
command
|
|
|
transport-override/cmd/server
command
|
|
|
transport-override/override
Code generated by protoc-gen-tego.
|
Code generated by protoc-gen-tego. |
|
internal
|
|