Documentation ¶
Index ¶
Constants ¶
View Source
const ( FileModeOnlyRead os.FileMode = 0444 FileModeReadWrite os.FileMode = 0666 )
FileMode
View Source
const (
DefaultReadBufferLength = 1024
)
DefaultReadBufferLength default reader buffer length
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileRepo ¶
type FileRepo interface { Open(file string) (*FileInfo, error) OpenFile(file string, flag int, perm os.FileMode) (*FileInfo, error) // FileOpened judge if file is opening FileOpened(string) bool // FileInfo get information with file name FileInfo(name string) (os.FileInfo, error) // Close close the file Close(file string) error // CloseAll close all files which were opened CloseAll() error // Read file Read(string) (b []byte, n int, err error) // Write rewrite file with context Write(name, context string, opts ...WriteOption) (int, error) WriteBytes(name string, b []byte, opts ...WriteOption) (int, error) // WriteAppend append context to the file WriteAppend(name, context string, opts ...WriteOption) (int, error) WriteAppendBytes(name string, b []byte, opts ...WriteOption) (int, error) // Rename rename file Rename(oldPath, newPath string) error // SetReadBufLength set length of buffer to read file, default: 1024 SetReadBufLength(int64) error }
FileRepo execute file functions
func NewFileRepo ¶
NewFileRepo return an new constraction of FileRepo
type Option ¶
type Option func(*Options)
func ConcurrencyRead ¶
func ConcurrencyRead() Option
func ReadBufferLength ¶
type WriteOption ¶
type WriteOption func(*WriteOptions)
func WriteFlag ¶
func WriteFlag(flag int) WriteOption
type WriteOptions ¶
type WriteOptions struct {
Flag *int
}
Click to show internal directories.
Click to hide internal directories.