config

package
v0.0.0-...-21cae54 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvPrefix is the environment prefix for the config.
	EnvPrefix string = "gosvc"
)

Variables

View Source
var (
	// EnvPrefixU is the upper case environment prefix for the config.
	EnvPrefixU string = strings.ToUpper(EnvPrefix)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// The host to listen on, e.g. "1.2.3.4".
	Host string
	// The port to listen on, e.g. 1234.
	Port int
}

Config contains configuration for this service

func LoadConfig

func LoadConfig(vi *viper.Viper, config *Config) (*Config, error)

LoadConfig loads the configuration and returns a config struct.

func NewConfig

func NewConfig() *Config

NewConfig returns a config struct with default values.

func (*Config) Address

func (c *Config) Address() string

Address returns the Address of the config as "{{ .Host }}:{{ .Port }".

func (*Config) Load

func (c *Config) Load(vi *viper.Viper) error

Load loads values into the config struct.

Jump to

Keyboard shortcuts

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