serverconfig

package
v0.0.0-...-3feb4d9 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenRedis

func OpenRedis(redisURL string, maxOpen, maxIdle int) (*redis.Pool, error)

func RegisterEnvs

func RegisterEnvs(iv interface{})

Types

type Config

type Config struct {
	Port         int              `mapstructure:"PORT"`
	AppMode      string           `mapstructure:"MODE"`
	DataTTL      int              `mapstructure:"DATA_TTL"`
	InMemory     bool             `mapstructure:"IN_MEMORY"`
	MaxNoteSize  uint             `mapstructure:"MAX_NOTE_SIZE"`
	RedisURL     string           `mapstructure:"REDIS_URL"`
	RedisMaxOpen int              `mapstructure:"REDIS_MAX_OPEN"`
	RedisMaxIdle int              `mapstructure:"REDIS_MAX_IDLE"`
	LoggingLevel config.LogginLvl `mapstructure:"LOGGING_LEVEL"`
}

func LoadConfig

func LoadConfig() (*Config, error)

Jump to

Keyboard shortcuts

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