代码拉取完成,页面将自动刷新
// Package gfpool provides io-reusable pool for file pointer.
package gfpool
import (
"gitee.com/micro-tools/wf/container/gmap"
"gitee.com/micro-tools/wf/container/gpool"
"gitee.com/micro-tools/wf/container/gtype"
"os"
"time"
)
// File pointer pool.
type Pool struct {
id *gtype.Int // Pool id, which is used to mark this pool whether recreated.
pool *gpool.Pool // Underlying pool.
init *gtype.Bool // Whether initialized, used for marking this file added to fsnotify, and it can only be added just once.
ttl time.Duration // Time to live for file pointer items.
}
// File is an item in the pool.
type File struct {
*os.File // Underlying file pointer.
stat os.FileInfo // State of current file pointer.
pid int // Belonging pool id, which is set when file pointer created. It's used to check whether the pool is recreated.
pool *Pool // Belonging ool.
flag int // Flash for opening file.
perm os.FileMode // Permission for opening file.
path string // Absolute path of the file.
}
var (
// Global file pointer pool.
pools = gmap.NewStrAnyMap(true)
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。