rgconfig

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get added in v1.0.15

func Get(param string) (data interface{})

* @Content : 获取配置 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-01

func GetBool

func GetBool(param string) (data bool)

* @Content : 获取配置 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-01

func GetContent

func GetContent() (data string)

* @Content : 获取配置 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-01

func GetInt

func GetInt(param string) (data int64)

* @Content : 获取int64类型 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-05-11

func GetStr

func GetStr(param string) (data string)

* @Content : 获取配置 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-01

func GetStrMap

func GetStrMap(param string) (data map[string]string)

* @Content : 获取配置 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-01

func GetStrSlice

func GetStrSlice(param string) (data []string)

* @Content : 获取配置 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-01

func Isset

func Isset(param string) (ok bool)

* @Content : 是否存在 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-04

func ReadFile

func ReadFile() []byte

func Register

func Register(name string, c ConfigInterface)

func Reload

func Reload() (err error)

* @Content : 重新加载 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-04

func Start

func Start()

Types

type BaseConfig

type BaseConfig struct {
	Config               string `yaml:"config"`
	ApolloAppId          string `yaml:"apollo_app_id"`
	ApolloCluster        string `yaml:"apollo_cluster"`
	ApolloHost           string `yaml:"apollo_host"`
	ApolloIsBackupConfig bool   `yaml:"apollo_is_backup_config"`
	ApolloSecret         string `yaml:"apollo_secret"`
	ApolloNamespaceName  string `yaml:"apollo_namespace_name"`
	SysAppName           string `yaml:"sys_app_name"`
}
var Config BaseConfig

type ConfigInterface

type ConfigInterface interface {
	Get(string) interface{}             // 获取interface类型
	GetStr(string) string               // 获取String类型
	GetInt(string) int64                // 获取int64类型
	GetBool(string) bool                // 获取bool类型
	GetStrMap(string) map[string]string // 获取map[string]string类型
	GetStrSlice(string) []string        // 获取[]string类型
	GetContent() string                 // 获取所有配置文件string
	Isset(string) bool                  // 判断配置是否存在
	Reload() error                      // 重新加载配置
	Load() func() error
}

<LiJunDong : 2022-03-02 16:08:36> --- 各种缓存标准interface

type Option

type Option struct {
	Config string `long:"config" required:"false"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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