package remotefs
import "github.com/Microsoft/opengcs/service/gcsutils/remotefs"
Index ¶
- Constants
- Variables
- func ExportedToError(ee *ExportedError) error
- func ReadTarOptions(r io.Reader) (*archive.TarOptions, error)
- func WriteError(err error, out io.Writer) error
- func WriteFileHeader(w io.Writer, hdr *FileHeader, extraData []byte) error
- func WriteTarOptions(w io.Writer, opts *archive.TarOptions) error
- type ExportedError
- type FileHeader
- type FileInfo
- func (f *FileInfo) IsDir() bool
- func (f *FileInfo) ModTime() time.Time
- func (f *FileInfo) Mode() os.FileMode
- func (f *FileInfo) Name() string
- func (f *FileInfo) Size() int64
- func (f *FileInfo) Sys() interface{}
- type SeekHeader
Constants ¶
const ( StatCmd = "stat" LstatCmd = "lstat" ReadlinkCmd = "readlink" MkdirCmd = "mkdir" MkdirAllCmd = "mkdirall" RemoveCmd = "remove" RemoveAllCmd = "removeall" LinkCmd = "link" SymlinkCmd = "symlink" LchmodCmd = "lchmod" LchownCmd = "lchown" MknodCmd = "mknod" MkfifoCmd = "mkfifo" OpenFileCmd = "openfile" ReadFileCmd = "readfile" WriteFileCmd = "writefile" ReadDirCmd = "readdir" ResolvePathCmd = "resolvepath" ExtractArchiveCmd = "extractarchive" ArchivePathCmd = "archivepath" )
Name of the commands when called from the cli context (remotefs <CMD> ...)
const ( // Read request command. Read uint32 = iota // Write request command. Write // Seek request command. Seek // Close request command. Close // CmdOK is a response meaning request succeeded. CmdOK // CmdFailed is a response meaning request failed. CmdFailed )
const RemotefsCmd = "remotefs"
RemotefsCmd is the name of the remotefs meta command
Variables ¶
ErrInvalid is returned if the parameters are invalid
ErrUnknown is returned for an unknown remotefs command
Functions ¶
func ExportedToError ¶
func ExportedToError(ee *ExportedError) error
ExportedToError will convert a ExportedError to an error. It will try to match the error to any existing known error like os.ErrNotExist. Otherwise, it will just return an implementation of the error interface.
func ReadTarOptions ¶
func ReadTarOptions(r io.Reader) (*archive.TarOptions, error)
ReadTarOptions reads from the specified reader and deserializes an archive.TarOptions struct.
func WriteError ¶
WriteError is an utility function that serializes the error and writes it to the output writer.
func WriteFileHeader ¶
func WriteFileHeader(w io.Writer, hdr *FileHeader, extraData []byte) error
WriteFileHeader serializes a FileHeader and writes it to w, along with any extra data
func WriteTarOptions ¶
func WriteTarOptions(w io.Writer, opts *archive.TarOptions) error
WriteTarOptions serializes a archive.TarOptions struct and writes it to the writer.
Types ¶
type ExportedError ¶
ExportedError is the serialized version of the a Go error. It also provides a trivial implementation of the error interface.
func ReadError ¶
func ReadError(in io.Reader) (*ExportedError, error)
ReadError is an utility function that reads a serialized error from the given reader and deserializes it.
func (*ExportedError) Error ¶
func (ee *ExportedError) Error() string
Error returns an error string
type FileHeader ¶
FileHeader is a header for remote *os.File operations for remotefs.OpenFile
func ReadFileHeader ¶
func ReadFileHeader(r io.Reader) (*FileHeader, error)
ReadFileHeader reads from r and returns a deserialized FileHeader
type FileInfo ¶
type FileInfo struct { NameVar string SizeVar int64 ModeVar os.FileMode ModTimeVar int64 // Serialization of time.Time breaks in travis, so use an int IsDirVar bool }
FileInfo is the stat struct returned by the remotefs system. It fulfills the os.FileInfo interface.
func (*FileInfo) IsDir ¶
IsDir returns the is-directory indicator from a FileInfo structure
func (*FileInfo) ModTime ¶
ModTime returns the modification time from a FileInfo structure
func (*FileInfo) Mode ¶
Mode returns the mode from a FileInfo structure
func (*FileInfo) Name ¶
Name returns the filename from a FileInfo structure
func (*FileInfo) Size ¶
Size returns the size from a FileInfo structure
func (*FileInfo) Sys ¶
func (f *FileInfo) Sys() interface{}
Sys provides an interface to a FileInfo structure
type SeekHeader ¶
SeekHeader is header for the Seek operation for remotefs.OpenFile
Source Files ¶
- Version
- v0.3.7
- Published
- Apr 11, 2018
- Platform
- windows/amd64
- Imports
- 10 packages
- Last checked
- 22 minutes ago –
Tools for package owners.