package configupgrade
import "go.mau.fi/util/configupgrade"
Index ¶
- Constants
- func Do(configPath string, save bool, upgrader BaseUpgrader, additional ...Upgrader) ([]byte, bool, error)
- type BaseUpgrader
- type CopyHelper
- func NewHelper(base, cfg *yaml.Node) *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
- func MergeUpgraders(base string, upgraders ...Upgrader) *StructUpgrader
- func (su *StructUpgrader) GetBase() string
- func (su *StructUpgrader) SpacedBlocks() [][]string
- type Upgrader
- type YAMLList
- type YAMLMap
- type YAMLNode
- type YAMLType
Constants ¶
const ( NullTag = "!!null" BoolTag = "!!bool" StrTag = "!!str" IntTag = "!!int" FloatTag = "!!float" TimestampTag = "!!timestamp" SeqTag = "!!seq" MapTag = "!!map" BinaryTag = "!!binary" )
Functions ¶
func Do ¶
func Do(configPath string, save bool, upgrader BaseUpgrader, additional ...Upgrader) ([]byte, bool, error)
Types ¶
type BaseUpgrader ¶
type CopyHelper ¶
func NewHelper ¶
func NewHelper(base, cfg *yaml.Node) *CopyHelper
func (*CopyHelper) AddSpaceBeforeComment ¶
func (helper *CopyHelper) AddSpaceBeforeComment(path ...string)
func (*CopyHelper) Copy ¶
func (helper *CopyHelper) Copy(allowedTypes YAMLType, path ...string)
func (*CopyHelper) Get ¶
func (helper *CopyHelper) Get(tag YAMLType, path ...string) (string, bool)
func (*CopyHelper) GetBase ¶
func (helper *CopyHelper) GetBase(path ...string) string
func (*CopyHelper) GetBaseNode ¶
func (helper *CopyHelper) GetBaseNode(path ...string) *YAMLNode
func (*CopyHelper) GetNode ¶
func (helper *CopyHelper) GetNode(path ...string) *YAMLNode
func (*CopyHelper) Set ¶
func (helper *CopyHelper) Set(tag YAMLType, value string, path ...string)
func (*CopyHelper) SetMap ¶
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 ¶
func (*ProxyHelper) AddSpaceBeforeComment ¶
func (p *ProxyHelper) AddSpaceBeforeComment(path ...string)
func (*ProxyHelper) Copy ¶
func (p *ProxyHelper) Copy(allowedTypes YAMLType, path ...string)
func (*ProxyHelper) Get ¶
func (p *ProxyHelper) Get(tag YAMLType, path ...string) (string, bool)
func (*ProxyHelper) GetBase ¶
func (p *ProxyHelper) GetBase(path ...string) string
func (*ProxyHelper) GetBaseNode ¶
func (p *ProxyHelper) GetBaseNode(path ...string) *YAMLNode
func (*ProxyHelper) GetNode ¶
func (p *ProxyHelper) GetNode(path ...string) *YAMLNode
func (*ProxyHelper) Set ¶
func (p *ProxyHelper) Set(tag YAMLType, value string, path ...string)
func (*ProxyHelper) SetMap ¶
func (p *ProxyHelper) SetMap(value YAMLMap, path ...string)
type ProxyUpgrader ¶
func (*ProxyUpgrader) DoUpgrade ¶
func (p *ProxyUpgrader) DoUpgrade(helper Helper)
func (*ProxyUpgrader) SpacedBlocks ¶
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 ¶
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 YAMLList ¶
type YAMLList []YAMLNode
type YAMLMap ¶
type YAMLNode ¶
func StringNode ¶
func (*YAMLNode) UpdateContent ¶
func (yn *YAMLNode) UpdateContent()
type YAMLType ¶
type YAMLType uint32
func (YAMLType) String ¶
Source Files ¶
helper.go proxyhelper.go upgrade.go
- Version
- v0.8.6 (latest)
- Published
- Mar 16, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 week ago –
Tools for package owners.