app

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 5 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 {
	// contains filtered or unexported fields
}

Config is custom application configuration.

func NewConfig

func NewConfig(configPath string, configName string) (*Config, error)

NewConfig sets up the app configuration, setting default values and configurations.

func NewDefaultConfig

func NewDefaultConfig() (*Config, error)

NewDefaultConfig returns a new Config with default values

func (*Config) AllSettings

func (c *Config) AllSettings() map[string]interface{}

AllSettings returns all settings as map.

func (*Config) Bool

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

Bool returns a key's value as bool.

func (*Config) Duration

func (c *Config) Duration(key string) time.Duration

Duration returns a key's value as time.Duration.

func (*Config) Float64

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

Float64 returns a key's value as float64.

func (*Config) Int

func (c *Config) Int(key string) int

Int returns a key's value as int.

func (*Config) IsSet

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

IsSet checks if the key has assigned value.

func (*Config) Set

func (c *Config) Set(key string, value interface{})

Set sets a value to a key.

func (*Config) String

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

String returns a key's value as string.

func (*Config) StringMap

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

StringMap returns a key's value as map[string]interface{}.

func (*Config) StringMapString

func (c *Config) StringMapString(key string) map[string]string

StringMapString returns a key's value as map[string]string.

func (*Config) StringSlice

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

StringSlice returns a key's value as []string.

func (*Config) Time

func (c *Config) Time(key string) time.Time

Time returns a key's value as time.Time.

Jump to

Keyboard shortcuts

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