common

package
v0.0.0-...-ae6897b Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LN  = '\n'
	LR  = '\r'
	SLN = "\n"
	SLR = "\r"
)

Variables

This section is empty.

Functions

func FileSize

func FileSize(fp string) (int64, error)

func If

func If(condition bool, trueVal, falseVal interface{}) interface{}

三元运算

func IsExist

func IsExist(fp string) bool

func Load

func Load(fname string, dec NewDecoder, x interface{}) error

func LoadYAML

func LoadYAML(fname string, x interface{}) error

func ReadLine

func ReadLine(reader io.Reader, lineHandler func(string))

func ReadLine2

func ReadLine2(reader io.Reader, lineHandler func(string))

func Remove

func Remove(path string) bool

func Save

func Save(fname string, enc NewEncoder, x interface{}) error

func SaveYAML

func SaveYAML(fname string, x interface{}) error

Types

type Decoder

type Decoder interface {
	Decode(v interface{}) error
}

type Encoder

type Encoder interface {
	Encode(v interface{}) error
}

type NewDecoder

type NewDecoder func(r io.Reader) Decoder

type NewEncoder

type NewEncoder func(w io.Writer) Encoder

Jump to

Keyboard shortcuts

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