fileutil

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFn

func GenerateFn(pattern *strftime.Strftime, clock interface{ Now() time.Time }, rotationTime time.Duration) string

GenerateFn creates a fh name based on the pattern, the current time, and the rotation time.

The bsase time that is used to generate the filename is truncated based on the rotation time.

func Get4096ByteNbsp

func Get4096ByteNbsp() []byte

Types

type BuffIO

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

func (*BuffIO) Close

func (d *BuffIO) Close() error

func (*BuffIO) CreateFile

func (d *BuffIO) CreateFile(filename string) error

CreateFile creates a new fh in the given path, creating parent directories as necessary

func (*BuffIO) SyncFile

func (d *BuffIO) SyncFile() error

func (*BuffIO) Write

func (d *BuffIO) Write(data []byte) (int, error)

type IOWriter

type IOWriter interface {
	CreateFile(filename string) error
	Write(p []byte) (n int, err error)
	Close() error
	SyncFile() error
}

func GenerateBuffIO

func GenerateBuffIO() IOWriter

GenerateBuffIO CreateFile creates a new fh in the given path, creating parent directories as necessary

Jump to

Keyboard shortcuts

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