writer

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 11

Documentation

Index

Constants

View Source
const MB = 1024 * 1024

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWriter

type FileWriter struct {
	FilenameFunc func(*FileWriter) string
	// contains filtered or unexported fields
}

FileWriter 文件写入结构体

func NewFileWriter

func NewFileWriter(opts ...Option) (*FileWriter, error)

NewFileWriter 实例化FileWriter, 支持大文件分割

func (*FileWriter) Write

func (p *FileWriter) Write(data []byte) (n int, err error)

Write 写入方法

type Option added in v1.3.6

type Option func(*Options)

Option set options

func WithCap added in v1.3.6

func WithCap(n uint) Option

WithCap set cap

func WithDaysToKeep added in v1.5.2

func WithDaysToKeep(n uint) Option

WithDaysToKeep 设置文件保留天数

func WithPath added in v1.3.6

func WithPath(s string) Option

WithPath 设置文件路径

func WithSuffix added in v1.3.6

func WithSuffix(s string) Option

WithSuffix 设置文件扩展名

type Options added in v1.3.6

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

Options 可配置参数

Jump to

Keyboard shortcuts

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