config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessConf added in v0.4.0

type AccessConf struct {
	AccessTokenExp string `json:"access_token_exp" yaml:"accessTokenExp"`
	SecurityKey    string `json:"security_key" yaml:"securityKey"`
}

type Configuration

type Configuration struct {
	// HTTPAddr http server listen address.
	HTTPAddr string `json:"http_addr" yaml:"httpAddr"`
	// GRPCAddr grpc server listen address.
	GRPCAddr string `json:"grpc_addr" yaml:"grpcAddr"`
	// Tkeel tkeel configuration.
	Tkeel *TkeelConf `json:"tkeel" yaml:"tkeel"`
	// Proxy tkeel platform configuration.
	Proxy *ProxyConf `json:"proxy" yaml:"proxy"`
	// Dapr dapr configuration.
	Dapr *DaprConf `json:"dapr" yaml:"dapr"`
	// Log log configuration.
	Log *LogConf `json:"log" yaml:"log"`
	// SecurityConf security auth config.
	SecurityConf *SecurityConf `json:"security_conf" yaml:"securityConf"`
	// CacheURL security auth`s redis config.
	CacheURL string `json:"cache_url" yaml:"cacheUrl"`
	// DatabaseURL security auth`s mysql config.
	DatabaseURL string `json:"database_url" yaml:"databaseUrl"`
	// DeploymentConfigMap deployment config.
	DeploymentConfigmap string `json:"deployment_configmap" yaml:"deploymentConfigmap"`
}

Configuration.

func LoadStandaloneConfiguration

func LoadStandaloneConfiguration(configPath string) (*Configuration, error)

LoadStandaloneConfiguration gets the path to a config file and loads it into a configuration.

func NewDefaultConfiguration added in v0.2.0

func NewDefaultConfiguration() *Configuration

NewDefaultConfiguration returns the empty config.

func (*Configuration) AttachCmdFlags added in v0.2.0

func (c *Configuration) AttachCmdFlags(strVar func(p *string, name string, value string, usage string),
	boolVar func(p *bool, name string, value bool, usage string), intVar func(p *int, name string, value int, usage string))

func (*Configuration) Init added in v0.4.0

func (c *Configuration) Init()

type DaprConf added in v0.2.0

type DaprConf struct {
	// dapr sidecar grpc listen port.
	GRPCPort string `json:"grpc_port" yaml:"grpcPort"`
	// dapr sidecar http listen port.
	HTTPPort string `json:"http_port" yaml:"httpPort"`
	// private state name.
	PrivateStateName string `json:"private_state_name" yaml:"privateStateName"`
	// public state name.
	PublicStateName string `json:"public_state_name" yaml:"publicStateName"`
}

DaprConf dapr sidecar configuration.

type EntityConf added in v0.4.0

type EntityConf struct {
	SecurityKey string `json:"security_key" yaml:"securityKey"`
}

type LogConf added in v0.2.0

type LogConf struct {
	// log level.
	Level  string   `json:"level" yaml:"level"`
	Dev    bool     `json:"dev" yaml:"dev"`
	Output []string `json:"output" yaml:"output"`
}

LogConf log configuration.

type MysqlConf added in v0.4.0

type MysqlConf struct {
	DBName   string `json:"dbname" yaml:"dbname"` //nolint
	User     string `json:"user" yaml:"user"`
	Password string `json:"password" yaml:"password"`
	Host     string `json:"host" yaml:"host"`
	Port     string `json:"port" yaml:"port"`
}

type OauthConfig added in v0.4.0

type OauthConfig struct {
	AuthType       string      `json:"auth_type" yaml:"authType"`
	Redis          *RedisConf  `json:"redis" yaml:"redis"`
	AccessGenerate *AccessConf `json:"access_generate" yaml:"accessGenerate"`
}

type ProxyConf added in v0.2.0

type ProxyConf struct {
	// proxy timeout.
	Timeout string `json:"timeout" yamlL:"timeout"`
}

ProxyConf proxy service configuration.

type RedisConf added in v0.4.0

type RedisConf struct {
	Addr     string `json:"addr" yaml:"addr"`
	DB       int    `json:"db" yaml:"db"`
	Password string `json:"password" yaml:"password"`
}

type SecurityConf added in v0.2.0

type SecurityConf struct {
	// Mysql  mysql config of security.
	Mysql *MysqlConf `json:"mysql" yaml:"mysql"`
	// OAuth2Config oauth2 config of security.
	OAuth *OauthConfig `json:"oauth2" yaml:"oauth2"` // nolint
	// entity entity security config of auth.
	Entity *EntityConf `json:"entity" yaml:"entity"`
}

SecurityConf.

type TkeelConf added in v0.2.0

type TkeelConf struct {
	// tkeel platform namespace.
	Namespace string `json:"namespace" yaml:"namespace"`
	// AdminPassword admin password.
	AdminPassword string `json:"admin_password" yaml:"adminPassword"`
	// watch interval.
	WatchInterval string `json:"watch_interval" yaml:"watchInterval"`
}

TkeelConf tkeel platform configuration.

Jump to

Keyboard shortcuts

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