xxio

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 每次读取一行的reader函数操作..
	FuncReadline func() Readfunc = funcReadline
)

Functions

func DataDomainDir added in v0.0.9

func DataDomainDir(domain, module string) (string, error)

func IsIoErr

func IsIoErr(e error) bool

func IsIoOpErr

func IsIoOpErr(e error) (*net.OpError, bool)

func MkdirAll added in v0.0.9

func MkdirAll(filemode os.FileMode, dirs ...string) (string, error)

用来方便创建多级目录,如果目录已存在,不会返回错误

func MustDataDomainDir added in v0.0.9

func MustDataDomainDir(domain, module string) string

func MustMkdirAll added in v0.0.11

func MustMkdirAll(filemode os.FileMode, dirs ...string) string

必须创建指定指定的目录,若创建失败,则引发panic

func MustTempDomainDir added in v0.0.9

func MustTempDomainDir(domain, module string) string

func MustUserConfigDir added in v0.0.9

func MustUserConfigDir(domain, module string) string

func NopReader added in v0.0.6

func NopReader() io.Reader

func NopWriter added in v0.0.6

func NopWriter() io.Writer

func ReadStringLine added in v0.0.8

func ReadStringLine(r io.Reader) ([]string, error)

func ReaderToChan

func ReaderToChan(r io.Reader, chanBuf int, rf Readfunc) (<-chan []byte, <-chan error)

开启一个goroutine 将reader中的数据行为操作转为使用chan通道的方式,还需要返回一个错误chan

func TempDomainDir added in v0.0.9

func TempDomainDir(domain, module string) (string, error)

func UserConfigDir added in v0.0.9

func UserConfigDir(domain, module string) (string, error)

返回当前系统 登录用户的默认配置目录,但结合 域和功能模块返回: ${homeDir}/domain/module/ 如果当前默认配置目录不存在, 就当前程序运行所在目录创建

Types

type Readfunc

type Readfunc func(r *bufio.Reader) ([]byte, error)

Jump to

Keyboard shortcuts

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