config

package
v2.0.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIllegalConfigError

func NewIllegalConfigError(configKey string) error

Types

type Config

type Config struct {
	Raw []byte
	// contains filtered or unexported fields
}

Config defines the struct of a configuration in general.

func LoadConfigFile

func LoadConfigFile(filename string) (*Config, error)

LoadConfigFile loads config information from a JSON file.

func LoadConfigString

func LoadConfigString(s string) *Config

LoadConfigString loads config information from a JSON string.

func (*Config) GetBool

func (c *Config) GetBool(key string) bool

GetBool returns a bool value for the config key.

func (*Config) GetFloat

func (c *Config) GetFloat(key string) float64

GetFloat returns a float value for the config key.

func (*Config) GetInt

func (c *Config) GetInt(key string) int64

GetBool returns a int value for the config key.

func (*Config) GetInt64

func (c *Config) GetInt64(key string) int64

GetBool returns a int64 value for the config key.

func (*Config) GetSlice

func (c *Config) GetSlice(key string) []interface{}

GetSlice returns an array for the config key.

func (*Config) GetString

func (c *Config) GetString(key string) string

GetString returns a string for the config key.

func (*Config) GetStringSlice

func (c *Config) GetStringSlice(key string) []string

Jump to

Keyboard shortcuts

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