Documentation ¶
Index ¶
- Constants
- Variables
- func GetPropertiesItemLineList(content string) []string
- func IsJson(content string) bool
- func IsProperty(content string) bool
- func IsYaml(content string) bool
- func JsonToFlatMap(content string) (map[string]string, error)
- func JsonToMap(contentOfJson string) (map[string]interface{}, error)
- func JsonToYaml(contentOfJson string) (string, error)
- func KvToProperties(key, value string, valueType TypeEnum) (string, error)
- func MapToProperties(dataMap map[string]interface{}) (string, error)
- func ObjectToYaml(value interface{}) (string, error)
- func PropertiesEntityToYaml(properties Properties) (string, error)
- func PropertiesToMap(contentOfProperties string) (map[string]string, error)
- func PropertiesToYaml(contentOfProperties string) (string, error)
- func RoutConfig(party iris.Party)
- func RouteInner(app *iris.Application)
- func YamlCheck(content string) error
- func YamlToFlatMap(content string) (map[string]string, error)
- func YamlToJson(contentOfYaml string) (string, error)
- func YamlToList(contentOfYaml string) ([]interface{}, error)
- func YamlToMap(contentOfYaml string) (map[string]interface{}, error)
- func YamlToProperties(contentOfYaml string) (string, error)
- func YamlToPropertiesWithKey(key string, contentOfYaml string) (string, error)
- type ConfigChangeEvent
- type ConfigChangeRequest
- type ConfigChangeType
- type ConvertError
- type NamespaceClientRequest
- type NamespaceDiff
- type NamespaceEditHistory
- type NamespaceHistory
- type NamespaceReq
- type Properties
- type StringPair
- type TypeEnum
- type YamlNode
Constants ¶
View Source
const ( ConfigAdd = ConfigChangeType("add") ConfigRemove = ConfigChangeType("remove") ConfigChange = ConfigChangeType("change") )
Variables ¶
View Source
var ArrayBlanks = "- "
ArrayBlanks 数组缩进
View Source
var Dot = "."
Dot 点
View Source
var IndentBlanks = " "
IndentBlanks 缩进空格
View Source
var NewLine = "\n"
NewLine 换行符
View Source
var SignEqual = "="
SignEqual 等号连接符
View Source
var SignSemicolon = ":"
SignSemicolon 分号连接符
View Source
var YamlNewLineDom = "|\n"
NewLineDom yaml的value换行符
Functions ¶
func IsProperty ¶
func JsonToYaml ¶
func MapToProperties ¶
MapToProperties 进行深层嵌套的map数据处理
func ObjectToYaml ¶
func PropertiesEntityToYaml ¶
func PropertiesEntityToYaml(properties Properties) (string, error)
func PropertiesToYaml ¶
func RouteInner ¶
func RouteInner(app *iris.Application)
func YamlToJson ¶
func YamlToList ¶
YamlToList 只适合转存粹是list的
func YamlToProperties ¶
Types ¶
type ConfigChangeEvent ¶
type ConfigChangeEvent struct { Namespace string `json:"namespace,omitempty"` Key string `json:"key,omitempty"` Type ConfigChangeType `json:"type,omitempty"` Current string `json:"current,omitempty"` Before string `json:"before,omitempty"` }
type ConfigChangeRequest ¶
type ConfigChangeRequest struct { AppId string `json:"appId,omitempty"` Group string `json:"group,omitempty"` Diff *NamespaceDiff `json:"diff,omitempty"` }
type ConfigChangeType ¶
type ConfigChangeType string
type ConvertError ¶
type ConvertError struct {
// contains filtered or unexported fields
}
func (*ConvertError) Error ¶
func (convertError *ConvertError) Error() string
type NamespaceClientRequest ¶
type NamespaceClientRequest struct { AppId string `json:"appId,omitempty"` Group string `json:"group,omitempty"` Namespaces []string `json:"namespaces,omitempty"` }
func (*NamespaceClientRequest) Keys ¶
func (r *NamespaceClientRequest) Keys() []string
Keys 获取一个应用锁监听的所有Namespace对应的 数据KEY列表
type NamespaceDiff ¶
type NamespaceDiff struct { Namespace string `json:"namespace,omitempty"` Same bool `json:"same,omitempty"` Added map[string]string `json:"added,omitempty"` Removed map[string]string `json:"removed,omitempty"` Changed map[string]StringPair `json:"changed,omitempty"` Unchanged map[string]string `json:"unchanged,omitempty"` }
type NamespaceEditHistory ¶
type NamespaceHistory ¶
type NamespaceHistory []*NamespaceEditHistory
func (NamespaceHistory) Len ¶
func (n NamespaceHistory) Len() int
func (NamespaceHistory) Less ¶
func (n NamespaceHistory) Less(i, j int) bool
func (NamespaceHistory) Swap ¶
func (n NamespaceHistory) Swap(i, j int)
type NamespaceReq ¶
type NamespaceReq struct { AppId string `json:"appId,omitempty"` Group string `json:"group,omitempty"` Namespace string `json:"namespace,omitempty"` Content string `json:"content,omitempty"` }
func (*NamespaceReq) Valid ¶
func (ns *NamespaceReq) Valid() error
type Properties ¶
type StringPair ¶
func JsonToKvList ¶
func JsonToKvList(content string) ([]StringPair, error)
func YamlToKvList ¶
func YamlToKvList(contentOfYaml string) ([]StringPair, error)
Click to show internal directories.
Click to hide internal directories.