 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
      View Source
      
  const ( FileModeOnlyRead os.FileMode = 0444 FileModeReadWrite os.FileMode = 0666 )
FileMode
      View Source
      
  const (
	ReadBufferLength = 1024
)
    ReadBufferLength default reader buffer length
Variables ¶
      View Source
      
  var ( ErrFileIsAlreadyOpen = errors.New("file is already open") ErrFailedReadFile = errors.New("failed read file") ErrReadBufferLengthBelowZero = errors.New("read buffer must above zero") )
errors
Functions ¶
This section is empty.
Types ¶
type FileRepo ¶
type FileRepo interface {
	// judge if file is opening
	FileOpened(string) bool
	// read file
	Read(string) (b []byte, n int, err error)
	// rewrite file with context
	Write(name, context string) (int, error)
	WriteBytes(name string, b []byte) (int, error)
	// append context to the file
	WriteAppend(name, context string) (int, error)
	WriteAppendBytes(name string, b []byte) (int, error)
	// rename file
	Rename(oldpath, newpath string) error
	// set length of buffer to read file, default: 1024
	SetReadBufLength(int) error
	// get information with file name
	FileInfo(name string) (os.FileInfo, error)
}
    FileRepo execute file functions
type FileStatus ¶
type FileStatus int
FileStatus defile file status
const ( // nothing FileStatusClosed FileStatus = iota // file is opened FileStatusOpening // file is moving or rename FileStatusMoving )
file status
 Click to show internal directories. 
   Click to hide internal directories.