config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOGLEVEL     = "LOG_LEVEL"
	PORT         = "PORT"
	EXPIRATION   = "EXPIRATION"
	MAINTENANCE  = "MAINTENANCE"
	PREALLOCATED = "PREALLOCATED"
	MODE         = "STORAGE_MODE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	LogLevel() LogLevel
	Port() int
	Expiration() time.Duration
	Maintenance() time.Duration
	Mode() StorageMode
	PreAllocated() int
	TimeSource() TimeSource
}

func NewConfigFromEnv

func NewConfigFromEnv() (Config, error)

type EnvConfig

type EnvConfig struct {
	// contains filtered or unexported fields
}

func (*EnvConfig) Expiration

func (o *EnvConfig) Expiration() time.Duration

func (*EnvConfig) LogLevel

func (o *EnvConfig) LogLevel() LogLevel

func (*EnvConfig) Maintenance

func (o *EnvConfig) Maintenance() time.Duration

func (*EnvConfig) Mode

func (o *EnvConfig) Mode() StorageMode

func (*EnvConfig) Port

func (o *EnvConfig) Port() int

func (*EnvConfig) PreAllocated

func (o *EnvConfig) PreAllocated() int

func (*EnvConfig) TimeSource

func (o *EnvConfig) TimeSource() TimeSource

type LogLevel

type LogLevel string
const (
	LogLevelDebug   LogLevel = "DEBUG"
	LogLevelInfo    LogLevel = "INFO"
	LogLevelWarning LogLevel = "WARNING"
	LogLevelError   LogLevel = "ERROR"
)

type StorageMode

type StorageMode string
const (
	StorageModeMap                StorageMode = "map"
	StorageModeSyncMap            StorageMode = "sync-map"
	StorageModePartitionedMap     StorageMode = "partitioned-map"
	StorageModePartitionedSyncMap StorageMode = "partitioned-sync-map"
)

type TimeSource

type TimeSource interface {
	Now() time.Time
}

Jump to

Keyboard shortcuts

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