configs

package
v0.0.0-...-9fc3f77 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Uri() string
}

type Config

type Config struct {
	Mode      string      `yaml:"mode"`
	JwtSecret string      `yaml:"jwtSecret"`
	Log       logger      `yaml:"log"`
	Orm       MysqlConfig `yaml:"orm"`
	Cache     RedisConfig `yaml:"cache"`
}

func Global

func Global() *Config

func Load

func Load(path string) *Config

func New

func New(mode, jwt, level, file, orm, cache string) *Config

type MysqlConfig

type MysqlConfig struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Database string `yaml:"database"`
	Net      string `yaml:"net"`
}

func (*MysqlConfig) Uri

func (cfg *MysqlConfig) Uri() string

type RedisConfig

type RedisConfig struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Database string `yaml:"database"`
}

func (*RedisConfig) Uri

func (cfg *RedisConfig) Uri() string

Uri redis :// [[username :] password@] host [:port][/database]

[?[timeout=timeout[d|h|m|s|ms|us|ns]] [&clientName=clientName]
[&libraryName=libraryName] [&libraryVersion=libraryVersion] ]

Jump to

Keyboard shortcuts

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