Documentation ¶
Index ¶
- func CanonicalizeMyCnfFile(f *ini.File, allowDuplicate bool) error
- func DiffMyCnfFile(old, new *ini.File, section string) map[string]string
- func IsIniKeyBooleanValue(k *ini.Key) bool
- func MoveDefaultSectionInto(f *ini.File, section string) error
- func ParseMyCnfOverlayFile(r io.Reader) (*ini.File, error)
- func ParseMyCnfTemplateFile(r io.Reader) (*ini.File, error)
- func Patch(origin, patch *ini.File) (*ini.File, error)
- func ToString(f *ini.File) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalizeMyCnfFile ¶
CanonicalizeMyCnfFile replaces every dash-linked variable with underscore_linked. It will silently overwrite the existing duplicate if allowDuplicate is true.
func DiffMyCnfFile ¶
func IsIniKeyBooleanValue ¶
func IsIniKeyBooleanValue(k *ini.Key) bool
IsIniKeyBooleanValue returns true when key is a bool value, aka. without value.
func MoveDefaultSectionInto ¶
func ParseMyCnfOverlayFile ¶
func ParseMyCnfTemplateFile ¶
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.
Types ¶
This section is empty.