global

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AutoMigrateModelList = []interface{}{
	model.User{},
	model.Cluster{},
	model.Project{},
	model.Label{},
	model.ClusterBind{},
	model.Namespace{},
	model.Serviceaccount{},
}

需要migrate 到数据库的信息

View Source
var Config = struct {
	DB     *confmysql.MySQL
	Server *confserver.Server

	TestEnvStr       string `env:""`
	Default_UserName string
	Default_PassWord string
}{
	Server: &confserver.Server{
		Mode: "debug",
	},

	DB: &confmysql.MySQL{
		DSN: "root:a8EyHxVuaZeS9J@tcp(127.0.0.1:3306)/cluster_mgr?charset=utf8mb4&parseTime=True&loc=Local",
		AutoMigrateConfig: &confmysql.AutoMigrateConfig{
			Models:    AutoMigrateModelList,
			ModelPath: "./internal/model",
			QueryPath: "./internal/query",
		},
		Config: &gorm.Config{
			Logger: logger.Default.LogMode(logger.Info),
		},
	},
	TestEnvStr:       "global.config",
	Default_UserName: "admin",
	Default_PassWord: "123456",
}

Functions

func InitUser

func InitUser(ctx context.Context, username, password string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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