util

package
v0.0.0-...-61b1583 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryingStreamClientInterceptor

func RetryingStreamClientInterceptor(duration time.Duration) func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

RetryingStreamClientInterceptor returns a ClientStreamInterceptor that retries both requests and responses

Types

type Logger

type Logger interface {
	// Error logs an Error level message
	Error(message string, args ...interface{})

	// Warn logs a Warn level message
	Warn(message string, args ...interface{})

	// Info logs an Info level message
	Info(message string, args ...interface{})

	// Debug logs a Debug level message
	Debug(message string, args ...interface{})

	// Trace logs a Trace level message
	Trace(message string, args ...interface{})

	// Send logs a sent message
	Send(messageType string, request interface{})

	// Receive logs a received message
	Receive(messageType string, response interface{})

	// SendTo logs a message send to a specific member
	SendTo(messageType string, request interface{}, member interface{})

	// ReceiveFrom logs a message received from a specific member
	ReceiveFrom(messageType string, response interface{}, member interface{})

	// ErrorFrom logs an error received from a specific member
	ErrorFrom(messageType string, err error, member interface{})

	// Request logs a request
	Request(requestType string, request interface{})

	// Response logs a response
	Response(responseType string, response interface{}, err error) error
}

Logger provides logging for requests and responses

func NewNodeLogger

func NewNodeLogger(node string) Logger

NewNodeLogger creates a new role logger

Jump to

Keyboard shortcuts

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