commandbusgrpc

package
v0.0.0-...-5fa8032 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(
	conn *grpc.ClientConn,
	opts ...ClientOption,
) *Client

func (*Client) CommandSink

func (c *Client) CommandSink(ctx context.Context, cmd *command.Command) (*command.Reply, error)

type ClientOption

type ClientOption func(*Client)

func WithClientCallOptions

func WithClientCallOptions(opts ...grpc.CallOption) ClientOption

func WithClientCodec

func WithClientCodec(c command.Encoding) ClientOption

func WithClientContextFunc

func WithClientContextFunc(fn ContextFunc) ClientOption

func WithClientRequestFunc

func WithClientRequestFunc(fn ClientRequestFunc) ClientOption

func WithClientResponseFunc

func WithClientResponseFunc(fn ClientResponseFunc) ClientOption

type ClientRequestFunc

type ClientRequestFunc func(metadata.MD, *command.Command)

type ClientResponseFunc

type ClientResponseFunc func(metadata.MD, *command.Reply)

type ContextFunc

type ContextFunc func(ctx context.Context) context.Context

type Server

type Server struct {
	proto.UnimplementedCommandBusServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	mutator stream.CommandSinker,
	opts ...ServerOption,
) *Server

func (*Server) CommandSink

func (s *Server) CommandSink(ctx context.Context, req *proto.Request) (*proto.Response, error)

func (*Server) Register

func (s *Server) Register(grpcSrv *grpc.Server)

type ServerErrorHandler

type ServerErrorHandler func(err error)

type ServerOption

type ServerOption func(*Server)

func WithServerCodec

func WithServerCodec(c command.Encoding) ServerOption

func WithServerContextFunc

func WithServerContextFunc(fn ContextFunc) ServerOption

func WithServerErrorHandler

func WithServerErrorHandler(fn ServerErrorHandler) ServerOption

func WithServerRequestFunc

func WithServerRequestFunc(fn ServerRequestFunc) ServerOption

type ServerRequestFunc

type ServerRequestFunc func(metadata.MD)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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