Documentation ¶
Index ¶
- Constants
- Variables
- func ArchiveGzipFile(srcFile string) error
- func CompressBytes(data []byte) ([]byte, error)
- func CopyFile(dest, source string) error
- func EnsureBaseDir(baseDir, path string) string
- func Fdatasync(f *os.File) error
- func Flock(f *os.File, exclusive bool, timeout time.Duration) error
- func Funlock(f *os.File) error
- func IsFileExist(filename string) bool
- func ReadFileToLines(filename string) ([]string, error)
- func ReadToLines(rd io.Reader) ([]string, error)
- func UncompressBytes(data []byte) ([]byte, error)
- func UniqueDirectory(path, name string) (string, error)
- type FileWriter
- type WriterMode
Constants ¶
View Source
const ( DefaultMaxFileBackup = 20 // DefaultMaxMBPerFile = 100 // 100M DefaultCapacity = 6000 // )
Variables ¶
View Source
var ErrTimeout = errors.New("timeout")
Functions ¶
func EnsureBaseDir ¶
EnsureBaseDir ensures that path is always prefixed by baseDir, allowing for the fact that path might have a Window drive letter in it.
func UniqueDirectory ¶
UniqueDirectory returns "path/name" if that directory doesn't exist. If it does, the method starts appending .1, .2, etc until a unique name is found.
Types ¶
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
func NewFileWriter ¶
func NewFileWriter(filename string, maxMBPerFile int, mode WriterMode) *FileWriter
func (*FileWriter) Close ¶
func (w *FileWriter) Close() error
type WriterMode ¶
type WriterMode int
const ( WriterSync WriterMode = 0 WriterAsync WriterMode = 1 WriterAsyncCopy WriterMode = 2 )
Click to show internal directories.
Click to hide internal directories.