dfpool

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File added in v0.1.2

type File struct {
	*os.File //基础的文件句柄
	// contains filtered or unexported fields
}

File 文件对象

func Open added in v0.1.2

func Open(path string, flag int, perm os.FileMode, ttl ...time.Duration) (file *File, err error)

Open 打开一个文件,并创建该文件的指针池,返回该文件的句柄

func (*File) Close added in v0.1.2

func (that *File) Close() error

Close 关闭文件指针对象池

func (*File) Stat added in v0.1.2

func (that *File) Stat() (os.FileInfo, error)

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool 文件指针池子

func New added in v0.1.2

func New(path string, flag int, perm os.FileMode, ttl ...time.Duration) *Pool

New 新建并返回一个文件指针池 Note the expiration logic: ttl = 0 : not expired; ttl < 0 : immediate expired after use; ttl > 0 : timeout expired; It is not expired in default.

func (*Pool) Close added in v0.1.2

func (that *Pool) Close()

Close 关闭当前文件指针池

func (*Pool) File added in v0.1.2

func (that *Pool) File() (*File, error)

File 从文件池中获取文件的指针

Jump to

Keyboard shortcuts

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