Documentation ¶
Index ¶
- Constants
- func Do(configPath string, save bool, upgrader BaseUpgrader, additional ...Upgrader) ([]byte, bool, error)
- type BaseUpgrader
- type CopyHelper
- func (helper *CopyHelper) AddSpaceBeforeComment(path ...string)
- func (helper *CopyHelper) Copy(allowedTypes YAMLType, path ...string)
- func (helper *CopyHelper) Get(tag YAMLType, path ...string) (string, bool)
- func (helper *CopyHelper) GetBase(path ...string) string
- func (helper *CopyHelper) GetBaseNode(path ...string) *YAMLNode
- func (helper *CopyHelper) GetNode(path ...string) *YAMLNode
- func (helper *CopyHelper) Set(tag YAMLType, value string, path ...string)
- func (helper *CopyHelper) SetMap(value YAMLMap, path ...string)
- type Helper
- type ProxyHelper
- func (p *ProxyHelper) AddSpaceBeforeComment(path ...string)
- func (p *ProxyHelper) Copy(allowedTypes YAMLType, path ...string)
- func (p *ProxyHelper) Get(tag YAMLType, path ...string) (string, bool)
- func (p *ProxyHelper) GetBase(path ...string) string
- func (p *ProxyHelper) GetBaseNode(path ...string) *YAMLNode
- func (p *ProxyHelper) GetNode(path ...string) *YAMLNode
- func (p *ProxyHelper) Set(tag YAMLType, value string, path ...string)
- func (p *ProxyHelper) SetMap(value YAMLMap, path ...string)
- type ProxyUpgrader
- type SimpleUpgrader
- type SpacedUpgrader
- type StructUpgrader
- type Upgrader
- type YAMLList
- type YAMLMap
- type YAMLNode
- type YAMLType
Constants ¶
View Source
const ( NullTag = "!!null" BoolTag = "!!bool" StrTag = "!!str" IntTag = "!!int" FloatTag = "!!float" TimestampTag = "!!timestamp" SeqTag = "!!seq" MapTag = "!!map" BinaryTag = "!!binary" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseUpgrader ¶
type CopyHelper ¶ added in v0.5.0
func NewHelper ¶
func NewHelper(base, cfg *yaml.Node) *CopyHelper
func (*CopyHelper) AddSpaceBeforeComment ¶ added in v0.5.0
func (helper *CopyHelper) AddSpaceBeforeComment(path ...string)
func (*CopyHelper) Copy ¶ added in v0.5.0
func (helper *CopyHelper) Copy(allowedTypes YAMLType, path ...string)
func (*CopyHelper) Get ¶ added in v0.5.0
func (helper *CopyHelper) Get(tag YAMLType, path ...string) (string, bool)
func (*CopyHelper) GetBase ¶ added in v0.5.0
func (helper *CopyHelper) GetBase(path ...string) string
func (*CopyHelper) GetBaseNode ¶ added in v0.5.0
func (helper *CopyHelper) GetBaseNode(path ...string) *YAMLNode
func (*CopyHelper) GetNode ¶ added in v0.5.0
func (helper *CopyHelper) GetNode(path ...string) *YAMLNode
func (*CopyHelper) Set ¶ added in v0.5.0
func (helper *CopyHelper) Set(tag YAMLType, value string, path ...string)
func (*CopyHelper) SetMap ¶ added in v0.5.0
func (helper *CopyHelper) SetMap(value YAMLMap, path ...string)
type Helper ¶
type Helper interface { Copy(allowedTypes YAMLType, path ...string) Get(tag YAMLType, path ...string) (string, bool) GetNode(path ...string) *YAMLNode GetBase(path ...string) string GetBaseNode(path ...string) *YAMLNode Set(tag YAMLType, value string, path ...string) SetMap(value YAMLMap, path ...string) AddSpaceBeforeComment(path ...string) }
type ProxyHelper ¶ added in v0.5.0
func (*ProxyHelper) AddSpaceBeforeComment ¶ added in v0.5.0
func (p *ProxyHelper) AddSpaceBeforeComment(path ...string)
func (*ProxyHelper) Copy ¶ added in v0.5.0
func (p *ProxyHelper) Copy(allowedTypes YAMLType, path ...string)
func (*ProxyHelper) Get ¶ added in v0.5.0
func (p *ProxyHelper) Get(tag YAMLType, path ...string) (string, bool)
func (*ProxyHelper) GetBase ¶ added in v0.5.0
func (p *ProxyHelper) GetBase(path ...string) string
func (*ProxyHelper) GetBaseNode ¶ added in v0.5.0
func (p *ProxyHelper) GetBaseNode(path ...string) *YAMLNode
func (*ProxyHelper) GetNode ¶ added in v0.5.0
func (p *ProxyHelper) GetNode(path ...string) *YAMLNode
func (*ProxyHelper) Set ¶ added in v0.5.0
func (p *ProxyHelper) Set(tag YAMLType, value string, path ...string)
func (*ProxyHelper) SetMap ¶ added in v0.5.0
func (p *ProxyHelper) SetMap(value YAMLMap, path ...string)
type ProxyUpgrader ¶ added in v0.5.0
func (*ProxyUpgrader) DoUpgrade ¶ added in v0.5.0
func (p *ProxyUpgrader) DoUpgrade(helper Helper)
func (*ProxyUpgrader) SpacedBlocks ¶ added in v0.5.0
func (p *ProxyUpgrader) SpacedBlocks() [][]string
type SimpleUpgrader ¶
type SimpleUpgrader func(helper Helper)
func (SimpleUpgrader) DoUpgrade ¶
func (su SimpleUpgrader) DoUpgrade(helper Helper)
type SpacedUpgrader ¶
type StructUpgrader ¶
type StructUpgrader struct { SimpleUpgrader Blocks [][]string Base string }
func MergeUpgraders ¶ added in v0.5.0
func MergeUpgraders(base string, upgraders ...Upgrader) *StructUpgrader
func (*StructUpgrader) GetBase ¶
func (su *StructUpgrader) GetBase() string
func (*StructUpgrader) SpacedBlocks ¶
func (su *StructUpgrader) SpacedBlocks() [][]string
type Upgrader ¶
type Upgrader interface {
DoUpgrade(helper Helper)
}
var NoopUpgrader Upgrader = &noopUpgrader{}
type YAMLNode ¶
func StringNode ¶
func (*YAMLNode) UpdateContent ¶
func (yn *YAMLNode) UpdateContent()
Click to show internal directories.
Click to hide internal directories.