config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{}

Functions

func InitFromFile

func InitFromFile(fileName string) error

func InitFromString

func InitFromString(str string) error

func NewDB

func NewDB(name string) (bool, db.DBClientInterface)

Types

type Config

type Config struct {
	DBConfigs        map[string]*DBConfig `yaml:"dbConfigs"`
	Debug            bool                 `yaml:"debug"`
	Token            TokenConfig          `yaml:"token"`
	SuperAdminRoleID string               `yaml:"superAdminRoleID"`
	PlatformTenantID string               `yaml:"platformTenantID"`
	DefaultRoleID    string               `yaml:"defaultRoleID"`
	DefaultPwd       string               `yaml:"defaultPwd"`
	MiniApp          []MiniAppConfig      `yaml:"miniApp"`
	EnableTenant     bool                 `yaml:"enableTenant"`
}

type DBConfig

type DBConfig struct {
	DBType        string `yaml:"dbType"`
	ConnectionStr string `yaml:"connectionStr"`
	FileName      string `yaml:"fileName"`
	UserName      string `yaml:"userName"`
	Password      string `yaml:"password"`
	Host          string `yaml:"Host"`
	DBName        string `yaml:"dbName"`
	Port          int    `yaml:"port"`
}

func GetDBConfig

func GetDBConfig(name string) (*DBConfig, bool)

type MiniAppConfig

type MiniAppConfig struct {
	ID       string `yaml:"id"`
	Name     string `yaml:"name"`
	Secret   string `yaml:"secret"`
	TenantID string `yaml:"tenantID"`
}

type TokenConfig

type TokenConfig struct {
	Key       string `yaml:"key"`
	RedisAddr string `yaml:"redisAddr"`
	RedisName string `yaml:"redisName"`
	RedisPwd  string `yaml:"redisPwd"`
	Expired   int    `yaml:"expired"`
}

Jump to

Keyboard shortcuts

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