config

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePort

func GetFreePort() (int, error)

Types

type Config

type Config struct {
	AppPort        string `mapstructure:"app_port"`
	GrpcPort       string `mapstructure:"grpc_port"`
	Debug          bool   `mapstructure:"debug"`
	ProfileEnabled bool   `mapstructure:"profile_enabled"`
	CacheDriver    string `mapstructure:"cache_driver"`

	AdminPassword string `mapstructure:"admin_password"`
	PrivateKey    string `mapstructure:"private_key"`

	WsSenderPlugin Plugin `mapstructure:"ws_sender_plugin"`
	PicturePlugin  Plugin `mapstructure:"picture_plugin"`

	UploadDir     string `mapstructure:"upload_dir"`
	UploadMaxSize string `mapstructure:"upload_max_size"`

	JaegerUser          string `mapstructure:"jaeger_user"`
	JaegerPassword      string `mapstructure:"jaeger_password"`
	JaegerAgentHostPort string `mapstructure:"jaeger_agent_host_port"`

	// mysql
	DBDriver   string `mapstructure:"db_driver"`
	DBHost     string `mapstructure:"db_host"`
	DBPort     string `mapstructure:"db_port"`
	DBUsername string `mapstructure:"db_username"`
	DBPassword string `mapstructure:"db_password"`
	DBDatabase string `mapstructure:"db_database"`

	Oidc []OidcSetting `mapstructure:"oidc"`
}

func Init

func Init(cfgFile string) *Config

func (*Config) MaxUploadSize

func (c *Config) MaxUploadSize() uint64

type OidcSetting

type OidcSetting struct {
	Name         string `mapstructure:"name"`
	Enabled      bool   `mapstructure:"enabled"`
	ProviderUrl  string `mapstructure:"provider_url"`
	ClientID     string `mapstructure:"client_id"`
	ClientSecret string `mapstructure:"client_secret"`
	RedirectUrl  string `mapstructure:"redirect_url"`
}

type Plugin

type Plugin struct {
	Name string         `mapstructure:"name"`
	Args map[string]any `mapstructure:"args"`
}

func (Plugin) GetArgs

func (p Plugin) GetArgs() map[string]any

Jump to

Keyboard shortcuts

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