options

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 4 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option represents a function that can be used to mutate an Options object

func Codec

func Codec(c codec.Codec) Option

Codec sets the codec that will transform the messages

func ListenAddr

func ListenAddr(addr string) Option

ListenAddr sets the address in which the gRPC server will listen on

func Logger

func Logger(l logger.Logger) Option

Logger sets the logger that will receive the log messages sent by the library

func Name

func Name(name string) Option

Name sets the name of the service

func Transport

func Transport(t transport.Transport) Option

Transport sets the transport that will deliver and receive messages to and from other services

type Options

type Options struct {
	Name       string
	ListenAddr string
	Logger     logger.Logger
	Codec      codec.Codec
	Transport  transport.Transport
	Router     router.Router
}

Options holds the configuration for a service instance

Jump to

Keyboard shortcuts

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