config

package
v0.0.0-...-e1e0af0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Port             int16         `mapstructure:"port"`
	BodyLimit        string        `mapstructure:"bodyLimit"`
	RequestStoreTime time.Duration `mapstructure:"requestStoreTime"`
	ForbiddenHeaders []string      `mapstructure:"forbiddenHeaders"`
	HistoryCount     int           `mapstructure:"historyCount"`
	MaxRequestCount  int           `mapstructure:"maxRequestCount"`
}

type Configuration

type Configuration struct {
	AppConfig   App   `mapstructure:"app"`
	RedisConfig Redis `mapstructure:"redis"`
	Rate        Rate  `mapstructure:"rate"`
}

func InitConfig

func InitConfig() *Configuration

type Rate

type Rate struct {
	Limit  int64         `mapstructure:"limit"`
	Period time.Duration `mapstructure:"period"`
}

type Redis

type Redis struct {
	Host     string `mapstructure:"host"`
	Port     int16  `mapstructure:"port"`
	Password string `mapstructure:"password"`
	DB       int    `mapstructure:"db"`
}

Jump to

Keyboard shortcuts

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