Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrConsulConfigLoad returned when env config for consul results in an error ErrConsulConfigLoad = errors.New("error loading consul config") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ServiceName string `env:"SERVICE_NAME"` Host string `env:"CONSUL_HOST,default=localhost"` Port int `env:"CONSUL_PORT,default=8500"` TTL int `env:"CONSUL_TTL,default=15"` }
Config - consul configuration
func NewConfig ¶
func NewConfig() *Config
NewConfig returns the parsed config for jetstream from env
func (*Config) UnmarshalEnv ¶
UnmarshalEnv env.EnvSet to GatewayConfig
type Consul ¶
type Consul struct { *Config // contains filtered or unexported fields }
Consul registry
func (*Consul) ConnectionString ¶
ConnectionString returns the formatted connection string using the config loaded
func (*Consul) HasInitializer ¶
func (*Consul) Initializer ¶
func (c *Consul) Initializer() component.Initializer
type Initializer ¶
type Initializer struct {
// contains filtered or unexported fields
}
func NewInitializer ¶
func NewInitializer(c *Consul) *Initializer
NewInitializer returns a new JetStream Initialiazer
func (*Initializer) AddDependency ¶
func (i *Initializer) AddDependency(dep interface{}) error
AddDependency adds necessary service components as dependencies
func (*Initializer) CanRun ¶
func (i *Initializer) CanRun() bool
CanRun returns true if the component has anything to Run
func (*Initializer) CanStop ¶
func (i *Initializer) CanStop() bool
CanRun returns true if the component has anything to Run
func (*Initializer) Dependencies ¶
func (i *Initializer) Dependencies() []string
Dependencies returns the string names of service components that are required as dependencies for this component
Click to show internal directories.
Click to hide internal directories.