options

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 7 Imported by: 11

Documentation

Index

Constants

View Source
const DefaultRPCPort = 7070

DefaultRPCPort is the port that will be used for RPC connections if no other is specified

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 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 RPCPort added in v1.1.0

func RPCPort(port int16) Option

RPCPort sets the port in which this service's RPC will listen on, as well as the port in which other services' RPC servers are listening on. Defaults to DefaultRPCPort

type Options

type Options struct {
	Name    string
	RPCPort int16

	Logger    logger.Logger
	Codec     codec.Codec
	Transport transport.Transport
	Router    router.Router
	Broker    broker.Broker
	Config    config.Config
	Discovery discovery.Discovery
}

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