config

package
v0.0.0-...-661c6f8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultExpirationTime = 7 * 24 * time.Hour // 7 days
	PurgeInterval         = 24 * time.Hour     // 1 day
)

Variables

View Source
var Config = new(ViperConfig)
View Source
var MemCache *cache.Cache

Functions

func InitCache

func InitCache()

Types

type APIs

type APIs struct {
	TopicSubscribeURI   string `mapstructure:"topic_subscribe"`
	TopicUnsubscribeURI string `mapstructure:"topic_unsubscribe"`
	PushMessageURI      string `mapstructure:"push_message_uri"`
	PushMulticastURI    string `mapstructure:"push_multicast_uri"`
	ProjectURI          string `mapstructure:"project_uri"`
	ProjectAllURI       string `mapstructure:"project_all_uri"`
	UserLoginURI        string `mapstructure:"user_login_uri"`
	UserLogoutURI       string `mapstructure:"user_logout_uri"`
	UserSignupURI       string `mapstructure:"user_signup_uri"`
}

type Core

type Core struct {
	AppName   string `mapstructure:"app_name"`
	Port      int    `mapstructure:"port"`
	Env       string `mapstructure:"env"`
	SecretKey string `mapstructure:"secret_key"`
}

type Datasource

type Datasource struct {
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Address  string `mapstructure:"address"`
	DBName   string `mapstructure:"dbname"`
}

type Redis

type Redis struct {
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Address  string `mapstructure:"address"`
	DBName   int    `mapstructure:"dbname"`
}

type ViperConfig

type ViperConfig struct {
	Core       *Core       `yaml:"core"`
	APIs       *APIs       `yaml:"apis"`
	Datasource *Datasource `yaml:"datasource"`
	Redis      *Redis      `yaml:"redis"`
}

Jump to

Keyboard shortcuts

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