codec

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(w io.Writer, items []*Item, isDecodeBefore bool) error

Encode encode items to toml string

func GetKeys

func GetKeys(content string) (keys []string, tree *toml.Tree, err error)

func IsTemplateStr

func IsTemplateStr(str string) bool

func TomlVarDecode

func TomlVarDecode(varStr string, varMap map[string]string) string

func TomlVarEncode

func TomlVarEncode(varStr string) string

func VarDecode

func VarDecode(varStr string) string

Types

type Item

type Item struct {
	Key       string
	Val       interface{}
	Typ       reflect.Kind
	Comment   string
	SourceTyp int
	Id        uint64
	DiffKey   string
}

Item config item

func Decode

func Decode(content string) ([]*Item, error)

Decode decode toml string to items

func DecodeToml

func DecodeToml(str string, isEncodeAfter bool) (list []*Item, err error)

DecodeToml 将字符串转化成为标准item list

Directories

Path Synopsis
Package toml is a TOML parser and manipulation library.
Package toml is a TOML parser and manipulation library.

Jump to

Keyboard shortcuts

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