config

package
v0.0.0-...-7b8a371 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DataBase   *gorm.DB
	Properties = &Config{}

	DockerCliPool pool.Pool
	EsCliPool     pool.Pool
)

Functions

func LoadConfig

func LoadConfig()

func NewDockerCliPool

func NewDockerCliPool() (pool.Pool, error)

func NewDockerClient

func NewDockerClient() (*client.Client, error)

func NewElasticSearchCliPool

func NewElasticSearchCliPool() (pool.Pool, error)

func NewEsClient

func NewEsClient() (*elastic.Client, error)

Types

type BufMan

type BufMan struct {
	Mode       string `mapstructure:"mode"`
	ServerHost string `mapstructure:"server_host"`
	Port       int    `mapstructure:"port"`

	PageTokenExpireTime time.Duration `mapstructure:"page_token_expire_time"`
	PageTokenSecret     string        `mapstructure:"page_token_secret"`

	UseFSStorage bool `mapstructure:"use_fs_storage"`
}

type Config

type Config struct {
	BufMan        BufMan        `mapstructure:"bufman"`
	MySQL         MySQL         `mapstructure:"mysql"`
	Docker        Docker        `mapstructure:"docker"`
	ElasticSearch ElasticSearch `mapstructure:"elastic_search"`
}

type Docker

type Docker struct {
	Host               string        `mapstructure:"host"`
	CACertPath         string        `mapstructure:"ca_cert_path"`
	CertPath           string        `mapstructure:"cert_path"`
	KeyPath            string        `mapstructure:"key_path"`
	MaxOpenConnections int           `mapstructure:"max_open_connections"`
	MaxIdleConnections int           `mapstructure:"max_idle_connections"`
	MaxIdleTime        time.Duration `mapstructure:"max_idle_time"`
}

type ElasticSearch

type ElasticSearch struct {
	Urls               []string      `mapstructure:"urls"`
	Username           string        `mapstructure:"username"`
	Password           string        `mapstructure:"password"`
	MaxOpenConnections int           `mapstructure:"max_open_connections"`
	MaxIdleConnections int           `mapstructure:"max_idle_connections"`
	MaxIdleTime        time.Duration `mapstructure:"max_idle_time"`
}

type MySQL

type MySQL struct {
	MysqlDsn           string        `mapstructure:"mysql_dsn"`
	MaxOpenConnections int           `mapstructure:"max_open_connections"`
	MaxIdleConnections int           `mapstructure:"max_idle_connections"`
	MaxLifeTime        time.Duration `mapstructure:"max_life_time"`
	MaxIdleTime        time.Duration `mapstructure:"max_idle_time"`
}

Jump to

Keyboard shortcuts

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