rpccommon

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SATTR_ATIME = (1 << 0)
	SATTR_GID   = (1 << 1)
	SATTR_MODE  = (1 << 2)
	SATTR_MTIME = (1 << 3)
	SATTR_SIZE  = (1 << 4)
	SATTR_UID   = (1 << 5)
)
View Source
const (
	O_RDONLY   uint16 = 0
	O_WRONLY   uint16 = (1 << 0)
	O_RDWR     uint16 = (1 << 1)
	O_APPEND   uint16 = (1 << 2)
	O_ASYNC    uint16 = (1 << 3)
	O_CREAT    uint16 = (1 << 4)
	O_EXCL     uint16 = (1 << 5)
	O_NOCTTY   uint16 = (1 << 6)
	O_NONBLOCK uint16 = (1 << 7)
	O_SYNC     uint16 = (1 << 8)
	O_TRUNC    uint16 = (1 << 9)
)
 open() flags. Different OSes use different values for open flags.
   We translate OS specific into system agnostic flags and back to
	 OS specific on the target system.
View Source
const UTIME_OMIT = ((1 << 30) - 2)

Variables

This section is empty.

Functions

func ErrnoToRPCErrorString

func ErrnoToRPCErrorString(err error) error

ErrnoToRPCErrorString returns a structured error that can be parsed on the client. This is necessary as RPC framework in the standard lib doesn't return an /error/ but a string with the error message.

func ErrnoToSym

func ErrnoToSym(errno syscall.Errno) string

ErrnoToSym converts system-specific errno codes to strings, to be converted back to errno codes on the other side.

This is needed as errno codes are not portable. (See Linux ENOTEMPTY vs Darwin EDESTADDRREQ). See also SymToErrno().

func RPCErrorStringTOErrno

func RPCErrorStringTOErrno(err error) (syserr syscall.Errno)

RPCErrorStringTOErrno converts a structured error into a syscall Errno. This is necessary as RPC framework in the standard lib doesn't return an /error/ but a string with the error message.

func SAFlagsToSystem

func SAFlagsToSystem(flagsIn uint16) (flags int)

SAFlagsToSystem converts the internal representation of open() flags to system-specific. See also SystemToSAFlags()

func SymToErrno

func SymToErrno(sym string) syscall.Errno

SymToErrno converts symbolic representaton of an errno to errno code. See also ErrnoToSym().

func SystemToSAFlags

func SystemToSAFlags(flagsIn int) (flags uint16)

SystemToSAFlags converts system-specific open() flags to an internal representation. See also SAFlagsToSystem()

Types

type CloseReply

type CloseReply struct{}

type CloseRequest

type CloseRequest struct {
	FD uintptr
}

type DirEntry

type DirEntry struct {
	Mode uint32
	Name string
	Ino  uint64
}

DirEntry holds essential information about an entry in a directory

type FsyncReply

type FsyncReply struct{}

type FsyncRequest

type FsyncRequest struct {
	FD    uintptr
	Flags uint32
}

type LinkReply

type LinkReply struct{}

type LinkRequest

type LinkRequest struct {
	OldFullPath string
	NewFullPath string
}

type MkdirReply

type MkdirReply StatReply

type MkdirRequest

type MkdirRequest struct {
	FullPath string
	Mode     os.FileMode
}

type OpenReply

type OpenReply struct {
	FD uintptr
	StatReply
}

type OpenRequest

type OpenRequest struct {
	FullPath string
	SAFlags  uint16 // System-agnostic flags
	Mode     os.FileMode
}

type ReadDirReply

type ReadDirReply struct {
	DirEntries []DirEntry
}

type ReadDirRequest

type ReadDirRequest struct {
	FullPath string
}

type ReadReply

type ReadReply struct {
	Data []byte
}

type ReadRequest

type ReadRequest struct {
	FD     uintptr
	Offset int64
	Num    int
}

type ReadlinkReply

type ReadlinkReply struct {
	LinkTarget string
}

type ReadlinkRequest

type ReadlinkRequest struct {
	FullPath string
}

type RenameReply

type RenameReply struct{}

type RenameRequest

type RenameRequest struct {
	FullPath    string
	FullNewPath string
	Flags       uint32
}

type RmdirReply

type RmdirReply struct{}

type RmdirRequest

type RmdirRequest struct {
	FullPath string
}

type SeekReply

type SeekReply struct {
	Num int64
}

type SeekRequest

type SeekRequest struct {
	FD     uintptr
	Offset int64
	Whence int
}

type SetAttrReply

type SetAttrReply StatReply

type SetAttrRequest

type SetAttrRequest struct {
	FullPath   string
	ValidAttrs uint32 // See SATTR_* bitmap
	ATime      time.Time
	MTime      time.Time
	UID        uint32
	GID        uint32
	Mode       uint32
	Size       uint64
}

func (*SetAttrRequest) GetATime

func (r *SetAttrRequest) GetATime() (m time.Time, ok bool)

func (*SetAttrRequest) GetGID

func (r *SetAttrRequest) GetGID() (g uint32, ok bool)

func (*SetAttrRequest) GetMTime

func (r *SetAttrRequest) GetMTime() (m time.Time, ok bool)

func (*SetAttrRequest) GetMode

func (r *SetAttrRequest) GetMode() (m uint32, ok bool)

func (*SetAttrRequest) GetSize

func (r *SetAttrRequest) GetSize() (m uint64, ok bool)

func (*SetAttrRequest) GetUID

func (r *SetAttrRequest) GetUID() (u uint32, ok bool)

func (*SetAttrRequest) SetATime

func (r *SetAttrRequest) SetATime(a time.Time)

func (*SetAttrRequest) SetGID

func (r *SetAttrRequest) SetGID(g uint32)

func (*SetAttrRequest) SetMTime

func (r *SetAttrRequest) SetMTime(m time.Time)

func (*SetAttrRequest) SetMode

func (r *SetAttrRequest) SetMode(m uint32)

func (*SetAttrRequest) SetSize

func (r *SetAttrRequest) SetSize(s uint64)

func (*SetAttrRequest) SetUID

func (r *SetAttrRequest) SetUID(u uint32)

type StatReply

type StatReply struct {
	Mode       uint32
	Nlink      uint32
	Ino        uint64
	UID        uint32
	GID        uint32
	Atime      int64
	Mtime      int64
	Ctime      int64
	Size       int64
	Blocks     int64
	Blksize    int32
	LinkTarget string
}

type StatRequest

type StatRequest struct {
	FullPath string
	FD       uintptr
	UseFD    bool
}

type SymlinkReply

type SymlinkReply struct{}

type SymlinkRequest

type SymlinkRequest struct {
	OldFullPath string
	NewFullPath string
}

type UnlinkReply

type UnlinkReply struct{}

type UnlinkRequest

type UnlinkRequest struct {
	FullPath string
}

type WriteReply

type WriteReply struct {
	Num int
}

type WriteRequest

type WriteRequest struct {
	FD     uintptr
	Offset int64
	Data   []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL