Documentation ¶
Index ¶
- Constants
- func ClientTLS(config *tls.Config) []grpc.DialOption
- func GRPCAnyCastAs[T proto.Message](in *anypb.Any, v T) error
- func NewGRPCClient[T any](ctx context.Context, in func(cc grpc.ClientConnInterface) T, addr string, ...) (T, io.Closer, error)
- func NewGRPCConn(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func NewOptionalTLSGRPCClient[T any](ctx context.Context, in func(cc grpc.ClientConnInterface) T, addr string, ...) (T, io.Closer, error)
- func NewOptionalTLSGRPCConn(ctx context.Context, addr string, tls *tls.Config, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func Recv[T any](recv RecvInterface[T], parser func(T) error) error
- func Send[T, O any](send SendInterface[T, O], batch func() (T, error)) (O, error)
- func TokenAuthInterceptors(token string) []grpc.DialOption
- type RecvInterface
- type SendInterface
Constants ¶
View Source
const AuthorizationGRPCHeader = "adb-authorization"
Variables ¶
This section is empty.
Functions ¶
func NewGRPCClient ¶
func NewGRPCConn ¶
func NewGRPCConn(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func NewOptionalTLSGRPCConn ¶
func NewOptionalTLSGRPCConn(ctx context.Context, addr string, tls *tls.Config, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func TokenAuthInterceptors ¶
func TokenAuthInterceptors(token string) []grpc.DialOption
Types ¶
type RecvInterface ¶
type RecvInterface[T any] interface { Recv() (T, error) grpc.ClientStream }
type SendInterface ¶
type SendInterface[T, O any] interface { Send(T) error CloseAndRecv() (O, error) grpc.ClientStream }
Click to show internal directories.
Click to hide internal directories.