ini

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalizeMyCnfFile

func CanonicalizeMyCnfFile(f *ini.File, allowDuplicate bool) error

CanonicalizeMyCnfFile replaces every dash-linked variable with underscore_linked. It will silently overwrite the existing duplicate if allowDuplicate is true.

func DiffMyCnfFile

func DiffMyCnfFile(old, new *ini.File, section string) map[string]string

func IsIniKeyBooleanValue

func IsIniKeyBooleanValue(k *ini.Key) bool

IsIniKeyBooleanValue returns true when key is a bool value, aka. without value.

func MoveDefaultSectionInto

func MoveDefaultSectionInto(f *ini.File, section string) error

func ParseMyCnfOverlayFile

func ParseMyCnfOverlayFile(r io.Reader) (*ini.File, error)

func ParseMyCnfTemplateFile

func ParseMyCnfTemplateFile(r io.Reader) (*ini.File, error)

func Patch

func Patch(origin, patch *ini.File) (*ini.File, error)

Patch patches the origin ini file with the given patch. Key with different values will be overwritten and new keys will be inserted. Patch extends the update-insert only behaviour with another delete semantic: patch a bool key with "-" suffix will try to delete the key without "-" in the original file. For example,

origin:

[mysqld]
core-file

patch:

[mysqld]
core-file-

After the Patch, the 'core-file' in origin will be removed.

func ToString

func ToString(f *ini.File) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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