io

package
v0.0.0-...-1b9c052 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncodingUnknown = Encoding("")
	EncodingYaml    = Encoding("yaml")
	EncodingXml     = Encoding("xml")
	EncodingJson    = Encoding("json")
)

Variables

View Source
var DefaultEncodingFormat = EncodingJson
View Source
var DefaultEncodingFormatString = "json"
View Source
var EncodingList = "json, yaml, xml"

Functions

func CreateFilePath

func CreateFilePath(path string, perm os.FileMode) (string, error)

func CreateFolder

func CreateFolder(dir string, perm os.FileMode) error

func DecodeGobValue

func DecodeGobValue(out interface{}, in []byte) error

func DecodeValue

func DecodeValue(out interface{}, in []byte, enc Encoding) error

func DeleteFile

func DeleteFile(file string) error

func EncodeGobValue

func EncodeGobValue(in interface{}) ([]byte, error)

func EncodeTextFormatSummary

func EncodeTextFormatSummary(in interface{}) ([]byte, error)

func EncodeValue

func EncodeValue(in interface{}, enc Encoding) ([]byte, error)

func FileExists

func FileExists(path string) bool

func GetCurrentPath

func GetCurrentPath() string

func GetDefaultConfigFile

func GetDefaultConfigFile(enc Encoding) (string, error)

func HomeFolder

func HomeFolder() string

func ReadConfig

func ReadConfig(enc Encoding, file string, config interface{}) error

Load Configuration from given file

func ReadNative

func ReadNative(file string, config interface{}) error

Load Configuration from given file

func SaveConfig

func SaveConfig(enc Encoding, file string, config interface{}) error

Save Configuration to given file

func SaveNative

func SaveNative(file string, config interface{}) error

Load Configuration from given file

Types

type Encoding

type Encoding string

func EncodingFromValue

func EncodingFromValue(value string) Encoding

func (Encoding) String

func (e Encoding) String() string

Jump to

Keyboard shortcuts

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