Documentation ¶
Overview ¶
Package configs Package @author <chengjiang@buffalo-robot.com> @date 2023-06-27 @note
Index ¶
- Constants
- func GetConfigPath(url string) (string, error)
- func RegisterConfig(config *FormatAppConfig) error
- func RegisterConfigByWeb(config *FormatAppConfig) error
- func RegisterGetConfiguration(url string, serviceConfig interface{}, registerParam *RegisterParam) error
- type AppConfig
- type ConfigType
- type EnvironmentType
- type FormatAppConfig
- type JsonData
- type NameSpace
- type RegisterParam
Constants ¶
View Source
const ( CONFIG_TYPE_Public = "Public" CONFIG_TYPE_Private = "Private" )
View Source
const ( ENV_TYPE_BETA = "Beta" ENV_TYPE_DEV = "Dev" ENV_TYPE_PRD = "Prd" )
Variables ¶
This section is empty.
Functions ¶
func GetConfigPath ¶
func RegisterConfig ¶
func RegisterConfig(config *FormatAppConfig) error
func RegisterConfigByWeb ¶
func RegisterConfigByWeb(config *FormatAppConfig) error
func RegisterGetConfiguration ¶
func RegisterGetConfiguration(url string, serviceConfig interface{}, registerParam *RegisterParam) error
RegisterGetConfiguration 注册请求,获取,更新相应的配置 注册配置,如果,没有,则注册,如果有,则返回配置中心的配置。
Types ¶
type AppConfig ¶
type AppConfig struct { Environment EnvironmentType `json:"environment"` // 环境,beta, dev, prd. AppId string `json:"appId"` ConfigType ConfigType `json:"configType"` AppName string `json:"appName"` Schema JsonData `json:"schema"` // 前端ui渲染, json格式 FormData JsonData `json:"formData"` // 前端ui渲染, json. }
type ConfigType ¶
type ConfigType string
type EnvironmentType ¶
type EnvironmentType string
type FormatAppConfig ¶
type FormatAppConfig struct { Environment EnvironmentType `json:"environment"` // 环境,beta, dev, prd. AppId string `json:"appId"` ConfigType ConfigType `json:"configType"` AppName string `json:"appName"` Schema map[string]interface{} `json:"schema"` // 前端ui渲染, json格式 FormData map[string]interface{} `json:"formData"` // 前端ui渲染, json. }
FormatAppConfig 方便转存为文件
func GetAppConfig ¶
func GetAppConfig(url, appId string) (*FormatAppConfig, error)
Click to show internal directories.
Click to hide internal directories.