config

package
v0.0.0-...-bcea5fb Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupEnvOrInt

func LookupEnvOrInt(k string, d int) int

LookupEnvOrInt attempts to fetch a configuration parameter via environment variable and convert to an int

func LookupEnvOrStr

func LookupEnvOrStr(k string, d string) string

LookupEnvOrStr attempts to fetch configuration parameter from environmnet variable and assign result as a string

Types

type Config

type Config struct {
	HTTPBindPort        int    // port we listen and serve
	HTTPBindAddress     string // IP or hostname to bind to
	HTTPDebugBindAddres string // Bind address for internal metrics/admin server
	HTTPDebugPort       int    // TCP port for admin/stats service.
	SourceAPIKey        string // LAST.FM api key
	SourceSharedSecret  string // LAST.fm shared secret
	CacheHost           string // Cache Host
	CachePort           int    // Cache port
	CacheSecret         string // secret key for cache connectivity
	LogFileLocation     string // logfile location
	MaxTopSimArtists    int
	MaxTopSimTracks     int
	MaxTopArtistTracks  int
	CacheTTLDuration    time.Duration // used internally after sting->duration conversion
}

func (*Config) SetCacheDuration

func (c *Config) SetCacheDuration(ttl string)

SetCacheDuration returns configuration data read from the target config file

Jump to

Keyboard shortcuts

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