Documentation ¶
Overview ¶
Package file provides ways to pass open files to across circuit runtimes
Index ¶
- type FileClient
- func (fcli *FileClient) Close() (err error)
- func (fcli *FileClient) Read(p []byte) (_ int, err error)
- func (fcli *FileClient) Readdir(count int) (_ []os.FileInfo, err error)
- func (fcli *FileClient) Seek(offset int64, whence int) (_ int64, err error)
- func (fcli *FileClient) Stat() (_ os.FileInfo, err error)
- func (fcli *FileClient) Sync() (err error)
- func (fcli *FileClient) Truncate(size int64) (err error)
- func (fcli *FileClient) Write(p []byte) (_ int, err error)
- type FileInfo
- type FileServer
- func (fsrv *FileServer) Close() error
- func (fsrv *FileServer) Read(n int) ([]byte, error)
- func (fsrv *FileServer) Readdir(count int) ([]os.FileInfo, error)
- func (fsrv *FileServer) Seek(offset int64, whence int) (int64, error)
- func (fsrv *FileServer) Stat() (os.FileInfo, error)
- func (fsrv *FileServer) Sync() error
- func (fsrv *FileServer) Truncate(size int64) error
- func (fsrv *FileServer) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileClient ¶
FileClient is a convenience wrapper for using a cross-interface, refering to a FileServer remote object.
func NewFileClient ¶
func NewFileClient(x circuit.X) *FileClient
NewFileClient consumes a cross-interface, backed by a FileServer on a remote worker, and returns a local proxy object with convinient access methods
func (*FileClient) Read ¶
func (fcli *FileClient) Read(p []byte) (_ int, err error)
Read reads a slice of bytes from this file.
func (*FileClient) Readdir ¶
func (fcli *FileClient) Readdir(count int) (_ []os.FileInfo, err error)
Readdir returns a directory listing of this file, if it is a directory.
func (*FileClient) Seek ¶
func (fcli *FileClient) Seek(offset int64, whence int) (_ int64, err error)
Seek seeks the cursor of this file.
func (*FileClient) Stat ¶
func (fcli *FileClient) Stat() (_ os.FileInfo, err error)
Stat returns meta-information about this file.
func (*FileClient) Sync ¶
func (fcli *FileClient) Sync() (err error)
Sync flushes any unflushed write buffers.
func (*FileClient) Truncate ¶
func (fcli *FileClient) Truncate(size int64) (err error)
Truncate truncates this file.
type FileInfo ¶
type FileInfo struct { SaveName string SaveSize int64 SaveMode os.FileMode SaveModTime time.Time SaveIsDir bool SaveSys interface{} }
FileInfo holds meta-information about a file.
func NewFileInfoOS ¶
NewFileInfoOS creates a new FileInfo structure from an os.FileInfo one.
type FileServer ¶
type FileServer struct {
// contains filtered or unexported fields
}
FileServer is an cross-worker exportable interface to a locally-open file.
func NewFileServer ¶
func NewFileServer(f *os.File) *FileServer
NewFileServer returns a file object which can be passed across runtimes. It makes sure to close the file if the no more references to the object remain in the circtui.
func (*FileServer) Read ¶
func (fsrv *FileServer) Read(n int) ([]byte, error)
Read reads a slice of bytes from this file.
func (*FileServer) Readdir ¶
func (fsrv *FileServer) Readdir(count int) ([]os.FileInfo, error)
Readdir lists the contents of this file, if it is a directory.
func (*FileServer) Seek ¶
func (fsrv *FileServer) Seek(offset int64, whence int) (int64, error)
Seek changes the position of the cursor in this file.
func (*FileServer) Stat ¶
func (fsrv *FileServer) Stat() (os.FileInfo, error)
Stat returns meta-information about this file.
func (*FileServer) Sync ¶
func (fsrv *FileServer) Sync() error
Sync flushes any unflushed write buffers.
func (*FileServer) Truncate ¶
func (fsrv *FileServer) Truncate(size int64) error
Truncate truncates this file.