config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	RpcPort  int32 `yaml:"rpcPort"`
	HttpPort int32 `yaml:"httpPort"`
}

type Config

type Config struct {
	Default  *DefaultConfig `yaml:"default"`
	DBConfig *DBConfig      `yaml:"dbConfig"`
	SQLs     []*SQLConfig   `yaml:"sqlConfig"`
}

func (*Config) FindSQLByName

func (c *Config) FindSQLByName(name string) *SQLConfig

func (*Config) Validate

func (c *Config) Validate() error

type DBConfig

type DBConfig struct {
	DSN           string `yaml:"dsn"`
	MaxOpenConn   int    `yaml:"maxOpenConn"`
	MinIdleConn   int    `yaml:"maxIdleConn"`
	MaxLifeSecond int    `yaml:"maxLifeTime"`
}

type DefaultConfig

type DefaultConfig struct {
	Mode string    `yaml:"mode"`
	App  AppConfig `yaml:"app"`
}

type SQLConfig

type SQLConfig struct {
	Name   string  `yaml:"name"`
	Table  string  `yaml:"table"`
	Sql    string  `yaml:"sql"`
	Select *Select `yaml:"select"`
}

type Select

type Select struct {
	Sql string `yaml:"sql"`
}

Jump to

Keyboard shortcuts

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