base_config

package
v0.0.0-...-cbc0f95 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(conf *Config, appConf interface{})

func InitFlags

func InitFlags(rootCmd *cobra.Command, conf *Config)

Types

type AppConfig

type AppConfig struct {
	Name                          string   `validate:"required"`
	ClientTimeout                 int      `validate:"required"`
	ShutdownTimeout               int      `validate:"required"`
	LoopInterval                  int      `validate:"required"`
	Listen                        string   `validate:"required"`
	HttpListen                    string   `validate:"required"`
	Endpoints                     []string `validate:"required"`
	CertFile                      string   `validate:"required"`
	KeyFile                       string   `validate:"required"`
	CaFile                        string   `validate:"required"`
	AccessControlAllowOrigin      string   `validate:"required"`
	AccessControlAllowCredentials string   `validate:"required"`
	ServerHostOverride            string   `validate:"required"`
	Targets                       []string `validate:"required"`
	Labels                        []string `validate:"required"`
	NodeServiceDownTimeDuration   int      `validate:"required"`
	Database                      DatabaseConfig
	Auth                          AuthConfig
	RootClient                    ClientConfig
}

type AuthConfig

type AuthConfig struct {
	Secrets             []string `validate:"required"`
	DefaultUsers        []AuthUser
	DefaultRoles        []AuthRole
	DefaultProjects     []AuthProject
	DefaultProjectRoles []AuthProjectRole
	DefaultServices     []AuthService
}

type AuthProject

type AuthProject struct {
	Name        string
	ProjectRole string
}

type AuthProjectRole

type AuthProjectRole struct {
	Name string
}

type AuthRole

type AuthRole struct {
	Name    string
	Project string
}

type AuthService

type AuthService struct {
	Name            string
	Icon            string
	Scope           string
	SyncRootCluster bool
	ProjectRoles    []string
}

type AuthUser

type AuthUser struct {
	Name     string
	Password string
	Roles    []string
}

type ClientConfig

type ClientConfig struct {
	User                  string `validate:"required"`
	Password              string `validate:"required"`
	Project               string `validate:"required"`
	Service               string `validate:"required"`
	Token                 string
	Endpoints             []string `validate:"required"`
	TlsInsecureSkipVerify bool
	LocalHandler          http.Handler
}

type Config

type Config struct {
	BaseDir           string
	Host              string
	ConfigDir         string
	ConfigFile        string
	TmpDir            string
	VarDir            string
	LogDir            string
	LogTimeFormat     string
	EnableTest        bool
	EnableDevelop     bool
	EnableDebug       bool
	EnableDatabaseLog bool
}

type DatabaseConfig

type DatabaseConfig struct {
	Connection string `validate:"required"`
}

Jump to

Keyboard shortcuts

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