poc

package
Version: v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CloseCommunication = errors.New("communication end")

Functions

func DecodeRequestFromClient

func DecodeRequestFromClient(log log.Logger) func(context.Context, interface{}) (interface{}, error)

func DecodeResponseFromServer

func DecodeResponseFromServer(log log.Logger) func(context.Context, interface{}) (interface{}, error)

func DisplayClientRequestHeaders

func DisplayClientRequestHeaders(logger log.Logger) func(context.Context, *metadata.MD) context.Context

func DisplayClientResponseHeaders

func DisplayClientResponseHeaders(logger log.Logger) func(context.Context, metadata.MD, metadata.MD) context.Context

func DisplayClientResponseTrailers

func DisplayClientResponseTrailers(logger log.Logger) func(context.Context, metadata.MD, metadata.MD) context.Context

func EncodeRequestToServer

func EncodeRequestToServer(log log.Logger) func(context.Context, interface{}) (interface{}, error)

func EncodeResponseToClient

func EncodeResponseToClient(log log.Logger) func(context.Context, interface{}) (interface{}, error)

func ExtractConsumedCorrelationID

func ExtractConsumedCorrelationID(logger log.Logger) func(context.Context, metadata.MD, metadata.MD) context.Context

func InjectCorrelationID

func InjectCorrelationID(logger log.Logger) func(context.Context, *metadata.MD) context.Context

func NewBinding

func NewBinding(svc Service) *serverBinding

func SetCorrelationID

func SetCorrelationID(ctx context.Context, v string) context.Context

Types

type Client

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

func (*Client) ApplyExtraOptions

func (c *Client) ApplyExtraOptions(options ...ClientOption)

func (Client) CallFullDuplex

func (c Client) CallFullDuplex(cctx context.Context) error

func (Client) CallHalfDuplex

func (c Client) CallHalfDuplex(extCtx context.Context, request *InternalRequest) error

func (Client) Logger

func (c Client) Logger() log.Logger

type ClientOption

type ClientOption func(*Client)

func ClientAfter

func ClientAfter(after ...kitGRPC.ClientResponseFunc) ClientOption

func ClientBefore

func ClientBefore(before ...kitGRPC.ClientRequestFunc) ClientOption

type InternalReply

type InternalReply struct {
	Ctx context.Context
	Msg string
}

type InternalRequest

type InternalRequest struct {
	Msg string
}

type RequestAndStreamHalfDuplex

type RequestAndStreamHalfDuplex struct {
	Request *pb.Request
	Stream  pb.Streams_HalfDuplexServer
}

request and stream for half duplex

type Service

type Service interface {
	HalfDuplex(request *pb.Request, stream pb.Streams_HalfDuplexServer) error
	FullDuplex(stream pb.Streams_FullDuplexServer) error
	Logger() log.Logger
}

func NewService

func NewService(log log.Logger) Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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