config

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key, fallback string) string

GetEnv looks up the given key from the environment, returning its value if it exists, and otherwise returning the given fallback value.

func GetEnvFloat64

func GetEnvFloat64(key string, fallback float64) float64

GetEnvFloat64 looks up the given key from the environment and expects a float64, returning the float64 value if it exists, and otherwise returning the given fallback value.

func GetEnvInt

func GetEnvInt(key string, fallback int) int

GetEnvInt looks up the given key from the environment and expects an integer, returning the integer value if it exists, and otherwise returning the given fallback value.

func GetEnvUint

func GetEnvUint(key string, fallback uint) uint

GetEnvUint looks up the given key from the environment and expects an unsigned integer, returning the integer value if it exists, and otherwise returning the given fallback value.

Types

type BloomFilter

type BloomFilter struct {
	ExpectedInsertions uint
	FPP                float64
	HashSeed           uint
}

BloomFilter config.

type Config

type Config struct {
	Domain      string
	Redis       Redis
	BloomFilter BloomFilter
}

Config is all config struct.

func Init

func Init() (*Config, error)

Init config content.

func (*Config) Dump

func (c *Config) Dump(w io.Writer) error

Dump outputs the current config information to the given Writer.

type Redis

type Redis struct {
	Addr     string
	Password string `json:"-"`
	DB       int
}

Redis config.

Jump to

Keyboard shortcuts

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