Documentation ¶
Index ¶
- Constants
- func ArchiveGzipFile(srcFile string) error
- func CompressBytes(data []byte) ([]byte, error)
- func CopyFile(dest, source string) error
- func EnsureBaseDir(baseDir, path string) string
- func IsFileExist(filename string) bool
- func LockFile(f *os.File) error
- 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)
- func UnlockFile(f *os.File) error
- type FileWriter
- type WriterMode
Constants ¶
View Source
const ( DefaultMaxFileBackup = 20 // DefaultMaxMBPerFile = 100 // 100M DefaultCapacity = 6000 // )
Variables ¶
This section is empty.
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.
func UnlockFile ¶
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 ¶ added in v1.1.1
type WriterMode int
const ( WriterSync WriterMode = 0 WriterAsync WriterMode = 1 WriterAsyncCopy WriterMode = 2 )
Click to show internal directories.
Click to hide internal directories.