config

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(filename string) error

Types

type Config

type Config struct {
	Env            RuntimeEnv `toml:"env"`
	PostgresURI    string     `toml:"postgres_uri"`
	RedisURI       string     `toml:"redis_uri"`
	MigrationFiles string     `toml:"migration_files"`
	Server         struct {
		Proto     string `toml:"proto"`
		Domain    string `toml:"domain"`
		APIDomain string `toml:"api_domain"`
		Port      int    `toml:"port"`
		Host      string `toml:"host"`
	} `toml:"server"`
	Mail struct {
		PrivateKey string `toml:"private_key"`
		PublicKey  string `toml:"public_key"`
		Domain     string `toml:"domain"`
	} `toml:"mail"`
	RateLimit struct {
		HTTPHeader     string `toml:"http_header"`
		QueryLimit     int    `toml:"query_limit"`
		QueryResetTime int    `toml:"query_reset_time"`
		MutLimit       int    `toml:"mut_limit"`
		MutResetTime   int    `toml:"mut_reset_time"`
		Cost           struct {
			CreateUser int `toml:"create_user"`
			PubThread  int `toml:"pub_thread"`
			PubPost    int `toml:"pub_post"`
		} `toml:"cost"`
	} `toml:"rate_limit"`
	// contains filtered or unexported fields
}

func Get

func Get() *Config

type RuntimeEnv

type RuntimeEnv string
const (
	DevEnv  RuntimeEnv = "dev"
	TestEnv RuntimeEnv = "test"
	ProdEnv RuntimeEnv = "prod"
)

func GetEnv

func GetEnv() RuntimeEnv

Jump to

Keyboard shortcuts

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