Documentation ¶
Index ¶
- Variables
- func RandomBase64(n int) (string, error)
- func RandomBytes(n int) ([]byte, error)
- type LinkToken
- type LoadEnv
- func (l LoadEnv) GetEnvBool(key string, lvl string, dVal bool) bool
- func (l LoadEnv) GetEnvInt(key string, lvl string, dVal int) int
- func (l LoadEnv) GetEnvString(key string, lvl string, dVal string) string
- func (l LoadEnv) GetEnvStringList(key string, lvl string, dVal []string) []string
- func (l LoadEnv) Validate()
Constants ¶
This section is empty.
Variables ¶
var Config = LoadConfig()
var HTTPBaseCookie http.Cookie
HTTPBaseCookie defines the base cookie setup for vcago
var NatsHost string
NatsHost is the ip of the nats service.
var NatsPort string
NatsPort is the port ot the nats service.
Functions ¶
func RandomBase64 ¶
RandomBase64 generate random Base64 string
Types ¶
type LinkToken ¶
type LinkToken struct { ID string `bson:"_id" json:"id"` Code string `bson:"code" json:"code"` ModelID string `bson:"model_id" json:"model_id"` Scope string `bson:"scope" json:"scope"` ExpiresAt int64 `bson:"expires_at" json:"expires_at"` Created int64 `bson:"created" json:"created"` }
func NewLinkToken ¶
type LoadEnv ¶
type LoadEnv []bool
LoadEnv used for loading environment variables.
func LoadConfig ¶
func LoadConfig() *LoadEnv
func (LoadEnv) GetEnvBool ¶
GetEnvBool load a key from environment variables as bool.
func (LoadEnv) GetEnvInt ¶
GetEnvInt loads a key from enviroment variables as int. The lvl param defines the log level. For warnings set "w" and for error set "e". If the variable is not used or can be ignored use n for do nothing. The default value can be set by the dVal param.
func (LoadEnv) GetEnvString ¶
GetEnvString loads a key from enviroment variables as string. The lvl param defines the log level. For warnings set "w" and for error set "e". If the variable is not used or can be ignored use n for do nothing. The default value can be set by the dVal param.
func (LoadEnv) GetEnvStringList ¶
GetEnvStringList as