config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigBySign

func GetConfigBySign[C any](sign ConfigSign) C

GetConfigBySign 根据签名获取配置

func GetIndexConfig

func GetIndexConfig() map[int]map[string]*IndexConfig

GetIndexConfig 获取有索引, 该函数将返回已加载的配置

func LoadConfigBySign

func LoadConfigBySign(sign ConfigSign)

LoadConfigBySign 根据签名加载配置

func LoadEasyConfig

func LoadEasyConfig()

LoadEasyConfig 加载无索引, 该函数将待加载的配置替换已加载的配置

func LoadIndexConfig

func LoadIndexConfig()

LoadIndexConfig 加载有索引, 该函数将待加载的配置替换已加载的配置

func SetConfigBySign

func SetConfigBySign[C any](sign ConfigSign, config C)

SetConfigBySign 根据签名设置配置

func SetEasyConfig

func SetEasyConfig(config *EasyConfig)

SetEasyConfig 设置无索引, 该函数将待加载的配置进行存储,不影响已加载的配置

func SetIndexConfig

func SetIndexConfig(config map[int]map[string]*IndexConfig)

SetIndexConfig 设置有索引, 该函数将待加载的配置进行存储,不影响已加载的配置

Types

type ConfigSign

type ConfigSign = string // 配置签名
var (
	IndexConfigSign ConfigSign = "IndexConfig"
	EasyConfigSign  ConfigSign = "EasyConfig"
)

func GetConfigSigns

func GetConfigSigns() []ConfigSign

GetConfigSigns 获取所有配置签名

type EasyConfig

type EasyConfig struct {
	Id    int                `json:"id,omitempty"`
	Count string             `json:"count,omitempty"`
	Award []string           `json:"award,omitempty"`
	Info  *EasyConfigInfo    `json:"info,omitempty"`
	Other []*EasyConfigOther `json:"other,omitempty"`
}

EasyConfig 无索引

func GetEasyConfig

func GetEasyConfig() *EasyConfig

GetEasyConfig 获取无索引, 该函数将返回已加载的配置

type EasyConfigInfo

type EasyConfigInfo struct {
	Id   int                 `json:"id,omitempty"`
	Name string              `json:"name,omitempty"`
	Info *EasyConfigInfoInfo `json:"info,omitempty"`
}

EasyConfigInfo 信息

type EasyConfigInfoInfo

type EasyConfigInfoInfo struct {
	Lv  int                    `json:"lv,omitempty"`
	Exp *EasyConfigInfoInfoExp `json:"exp,omitempty"`
}

EasyConfigInfoInfo 信息

type EasyConfigInfoInfoExp

type EasyConfigInfoInfoExp struct {
	Mux   int `json:"mux,omitempty"`
	Count int `json:"count,omitempty"`
}

EasyConfigInfoInfoExp 信息

type EasyConfigOther

type EasyConfigOther struct {
	Id   int    `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

EasyConfigOther 信息2

type IndexConfig

type IndexConfig struct {
	Id    int                 `json:"id,omitempty"`
	Count string              `json:"count,omitempty"`
	Award []string            `json:"award,omitempty"`
	Info  *IndexConfigInfo    `json:"info,omitempty"`
	Other []*IndexConfigOther `json:"other,omitempty"`
}

IndexConfig 有索引

type IndexConfigInfo

type IndexConfigInfo struct {
	Id   int                  `json:"id,omitempty"`
	Name string               `json:"name,omitempty"`
	Info *IndexConfigInfoInfo `json:"info,omitempty"`
}

IndexConfigInfo 信息

type IndexConfigInfoInfo

type IndexConfigInfoInfo struct {
	Lv  int                     `json:"lv,omitempty"`
	Exp *IndexConfigInfoInfoExp `json:"exp,omitempty"`
}

IndexConfigInfoInfo 信息

type IndexConfigInfoInfoExp

type IndexConfigInfoInfoExp struct {
	Mux   int `json:"mux,omitempty"`
	Count int `json:"count,omitempty"`
}

IndexConfigInfoInfoExp 信息

type IndexConfigOther

type IndexConfigOther struct {
	Id   int    `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

IndexConfigOther 信息2

Jump to

Keyboard shortcuts

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