common

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBOptions

type DBOptions struct {
	Driver       string        `yaml:"driver"`
	MysqlOptions *MysqlOptions `yaml:"mysqloptions"`
	ESOptions    *ESOptions    `yaml:"esoptions"`
}

func InitConfig

func InitConfig(cfgFile string) (*DBOptions, error)

func NewDefaultOptions

func NewDefaultOptions() *DBOptions

type ESOptions

type ESOptions struct {
	EndPoint string `yaml:"endpoint"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

func NewEsOptions

func NewEsOptions() *ESOptions

type MysqlOptions

type MysqlOptions struct {
	Host         string `yaml:"host"`
	Port         string `yaml:"port"`
	Username     string `yaml:"username"`
	Password     string `yaml:"password"`
	DBName       string `yaml:"dbName"`
	Charset      string `yaml:"charset"`
	ParseTime    bool   `yaml:"parseTime"`
	MaxIdleConns int    `yaml:"maxIdleConns"`
	MaxOpenConns int    `yaml:"maxOpenConns"`
	MaxLifetime  int    `yaml:"maxLifetime"`
	LogMode      bool   `yaml:"logMode"`
}

1. 定一个 MysqlOptions struct, 字段定一个存储client初始化需要的参数

func NewMysqlOptions

func NewMysqlOptions() *MysqlOptions

Jump to

Keyboard shortcuts

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