logbuffer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

文件Buffer 日志文件:PREFIX.INDEX.log 其中INDEX为0-N

func NewBuffer

func NewBuffer(prefix string) *Buffer

获得FileBuffer对象

func (*Buffer) Close

func (this *Buffer) Close() error

关闭

func (*Buffer) Read

func (this *Buffer) Read() (data []byte, err error)

读取数据

func (*Buffer) Write

func (this *Buffer) Write(data []byte) (n int, err error)

写入数据

type File

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

单个日志文件

func NewFile

func NewFile(name string) *File

获取新对象

func (*File) Close

func (this *File) Close() error

关闭文件句柄

func (*File) Delete

func (this *File) Delete() error

删除文件

func (*File) Read

func (this *File) Read() (data []byte, err error)

读取单行

func (*File) Size

func (this *File) Size() int

文件尺寸

func (*File) Sync

func (this *File) Sync() error

同步数据

func (*File) Write

func (this *File) Write(data []byte) (int, error)

写入数据

Jump to

Keyboard shortcuts

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