zutils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Zip

func Zip(dst io.Writer, src string) error

Zip 压缩文件或目录 @params dst io.Writer 压缩文件可写流 @params src string 待压缩源文件/目录路径

func ZipToFile

func ZipToFile(dst, src string) error

ZipToFile 压缩至文件 @params dst string 压缩文件目标路径 @params src string 待压缩源文件/目录路径 @return error 错误信息

Types

type IDWorker

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

func NewIDWorker

func NewIDWorker(workerId int64) (*IDWorker, error)

func (*IDWorker) NextID

func (w *IDWorker) NextID() (int64, error)

type Writer

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

func New

func New(path string) *Writer

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) SetCons

func (w *Writer) SetCons(b bool)

SetCons 同时输出控制台

func (*Writer) SetMaxAge

func (w *Writer) SetMaxAge(ma int)

SetMaxAge 最大保留天数

func (*Writer) SetMaxSize

func (w *Writer) SetMaxSize(ms int64)

SetMaxSize 单个日志最大容量

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Directories

Path Synopsis
commandline

Jump to

Keyboard shortcuts

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