config

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address                   string       `json:"address" validate:"nonzero"`
	Port                      string       `json:"port" validate:"nonzero"`
	Nats                      []NatsConfig `json:"nats"`
	Index                     string       `json:"index"`
	ServerCert                string       `json:"server_cert" validate:"nonzero"`
	ServerKey                 string       `json:"server_key" validate:"nonzero"`
	CACert                    string       `json:"ca_cert" validate:"nonzero"`
	MetronPort                int          `json:"metron_port" validate:"min=1"`
	LogLevelAddress           string       `json:"log_level_address"`
	LogLevelPort              int          `json:"log_level_port"`
	StalenessThresholdSeconds int          `json:"staleness_threshold_seconds" validate:"min=1"`
	PruningIntervalSeconds    int          `json:"pruning_interval_seconds" validate:"min=1"`
	MetricsEmitSeconds        int          `json:"metrics_emit_seconds" validate:"min=1"`
	ResumePruningDelaySeconds int          `json:"resume_pruning_delay_seconds" validate:"min=0"`
	WarmDurationSeconds       int          `json:"warm_duration_seconds" validate:"min=0"`
}

func NewConfig

func NewConfig(configJSON []byte) (*Config, error)

func (*Config) NatsServers

func (c *Config) NatsServers() []string

type NatsConfig

type NatsConfig struct {
	Host string `json:"host"`
	Port uint16 `json:"port"`
	User string `json:"user"`
	Pass string `json:"pass"`
}

Jump to

Keyboard shortcuts

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