g2abio

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MB int
)

常量,大小定义

Variables

This section is empty.

Functions

This section is empty.

Types

type ABFileOption

type ABFileOption struct {
	//文件最大值,超过该值自动备份,备份文件大小略大于该值
	FileMaxSize int
	//保存目录天数
	SaveDays int
	//writer buffer size,内存缓冲区大小
	BufferSize int
	//自动刷新数据到磁盘的周期,默认值为2秒
	AutoFlushPeriod time.Duration
	//检查删除过期文件目录间隔
	AutoDelPeriod time.Duration
}

ABFileOption 参数配置

type AbFile

type AbFile struct {
	Graceful *graceful.Graceful `inject:""`

	Config *g2config.Config `inject:""`
	// contains filtered or unexported fields
}

AbFile ...

func (*AbFile) Constructor

func (a *AbFile) Constructor()

Constructor ...

func (*AbFile) MustLogIO

func (a *AbFile) MustLogIO(name string) IWriter

MustLogIO ...

func (*AbFile) MustNewIO

func (a *AbFile) MustNewIO(filePath string, opts ...*ABFileOption) IWriter

MustNewIO ...获取一个io对象,一旦出错,将会panic

type IWriter

type IWriter interface {
	AfterShutdown()
	Closed() bool
	Close()
	Flush() (err error)
	Write(p []byte) (n int, err error)
	File() *os.File
}

IWriter ...

Jump to

Keyboard shortcuts

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