config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Main    Main    `yaml:"main"`
	Http    Http    `yaml:"http"`
	Redis   Redis   `yaml:"redis"`
	MySQL   MySQL   `yaml:"mysql"`
	MongoDB MongoDB `yaml:"mongodb"`
}

func GlobConfig

func GlobConfig() Config

func Init

func Init() (cfg Config, err error)

type Http

type Http struct {
	Port string `yaml:"port"`
}

type Main

type Main struct {
	JwtSigningKey string `yaml:"jwt_signing_key"`
}

type MongoDB

type MongoDB struct {
	URI string `yaml:"uri"`
}

type MySQL

type MySQL struct {
	URI string `yaml:"uri"`
}

type Redis

type Redis struct {
	// Mode 模式
	// 支持:single,sentinel,cluster
	Mode       string   `yaml:"mode"`
	MasterName string   `yaml:"master_name"`
	Addrs      []string `yaml:"addrs"`
	Database   string   `yaml:"database"`
	Username   string   `yaml:"username"`
	Password   string   `yaml:"password"`
}

Jump to

Keyboard shortcuts

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