config

package
v0.0.0-...-42bc17a Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigDefault string = `` /* 320-byte string literal not displayed */

Default config const ConfigDefault string = ` app_name: "authority" environment: development port: "80" token_ttl: 1800 log_level: 1 mysql: database: kontrol host: 127.0.0.1 password: mysql port: 3306 sslmode: disable timeout: 15 username: root connection_max: 20 connection_time: 300 connection_idle_max: 0 connection_idle_time: 10 log: true `

View Source
const ConfigTest string = `` /* 310-byte string literal not displayed */

Auto testing config

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppName     string `yaml:"app_name" mapstructure:"app_name"`
	HTTPPort    string `yaml:"port" mapstructure:"port"`
	MySQL       *MySQL `yaml:"mysql" mapstructure:"mysql"`
	Environment string `yaml:"environment" mapstructure:"environment"`
	TokenTTL    int64  `yaml:"token_ttl" mapstructure:"token_ttl"`
	LogLevel    uint8  `yaml:"log_level" mapstructure:"log_level"`
}

Config holds all settings of finportal

type MySQL

type MySQL struct {
	Host               string `yaml:"host" mapstructure:"host"`
	Port               int    `yaml:"port" mapstructure:"port"`
	Username           string `yaml:"username" mapstructure:"username"`
	Password           string `yaml:"password" mapstructure:"password"`
	Database           string `yaml:"database" mapstructure:"database"`
	SSLMode            string `yaml:"sslmode" mapstructure:"sslmode"`
	Timeout            int    `yaml:"timeout" mapstructure:"timeout"`
	ConnectionMax      int    `yaml:"connection_max" mapstructure:"connection_max"`
	ConnectionTime     int64  `yaml:"connection_time" mapstructure:"connection_time"`
	ConnectionIdleMax  int    `yaml:"connection_idle_max" mapstructure:"connection_idle_max"`
	ConnectionIdleTime int64  `yaml:"connection_idle_time" mapstructure:"connection_idle_time"`
	Log                bool   `yaml:"log" mapstructure:"log"`
}

MySQL ...

func (*MySQL) ConnectionString

func (c *MySQL) ConnectionString() string

ConnectionString ...

type Postgres

type Postgres struct {
	Host        string `yaml:"host" mapstructure:"host"`
	Port        int    `yaml:"port" mapstructure:"port"`
	Username    string `yaml:"username" mapstructure:"username"`
	Password    string `yaml:"password" mapstructure:"password"`
	Database    string `yaml:"database" mapstructure:"database"`
	SSLMode     string `yaml:"sslmode" mapstructure:"sslmode"`
	SSLRootCert string `yaml:"sslrootcert" mapstructure:"sslrootcert"`
	Timeout     int    `yaml:"timeout" mapstructure:"timeout"`
}

Postgres ...

func (*Postgres) ConnectionString

func (c *Postgres) ConnectionString() string

ConnectionString ...

func (*Postgres) FormatDSN

func (c *Postgres) FormatDSN() string

FormatDSN ...

Jump to

Keyboard shortcuts

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