Documentation
¶
Index ¶
Constants ¶
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 Environment ¶ added in v1.1.1
type Environment string
const ( EnvironmentDevelopment Environment = "development" EnvironmentStaging Environment = "staging" EnvironmentProduction Environment = "production" )
func ParseEnvironment ¶ added in v1.1.1
func ParseEnvironment(str string) Environment
func (Environment) IsDevelopment ¶ added in v1.1.1
func (e Environment) IsDevelopment() bool
func (Environment) IsProduction ¶ added in v1.1.1
func (e Environment) IsProduction() bool
func (Environment) IsStaging ¶ added in v1.1.1
func (e Environment) IsStaging() bool
type Option ¶
type Option func(*Options)
Option represents a function that can be used to mutate an Options object
func IfEnvironment ¶ added in v1.1.1
func IfEnvironment(env Environment, opts ...Option) Option
IfEnvironment conditionally applies options if running under a specific environment.
Make sure this option comes after any WithEnvironment options, if any.
func IfNotEnvironment ¶ added in v1.1.1
func IfNotEnvironment(env Environment, opts ...Option) Option
IfNotEnvironment conditionally applies options if running under any environment except for a specific one.
Make sure this option comes after any WithEnvironment options, if any.
func RPCPort ¶ added in v1.1.0
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
func WithEnvironment ¶ added in v1.1.1
func WithEnvironment(e Environment) Option
WithEnvironment sets the environment that the service is running under
type Options ¶
type Options struct {
Name string
RPCPort int16
Environment Environment
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