Versions in this module Expand all Collapse all v1 v1.13.6 Feb 25, 2022 Changes in this version + const AttrACModTime + const AttrExtended + const AttrPermissions + const AttrSize + const AttrUIDGID + const DefaultMaxDataLength + const DefaultMaxPacketLength + const FlagAppend + const FlagCreate + const FlagExclusive + const FlagRead + const FlagTruncate + const FlagWrite + const PacketTypeAttrs + const PacketTypeClose + const PacketTypeData + const PacketTypeExtended + const PacketTypeExtendedReply + const PacketTypeFSetstat + const PacketTypeFStat + const PacketTypeHandle + const PacketTypeInit + const PacketTypeLStat + const PacketTypeMkdir + const PacketTypeName + const PacketTypeOpen + const PacketTypeOpenDir + const PacketTypeRead + const PacketTypeReadDir + const PacketTypeReadLink + const PacketTypeRealPath + const PacketTypeRemove + const PacketTypeRename + const PacketTypeRmdir + const PacketTypeSetstat + const PacketTypeStat + const PacketTypeStatus + const PacketTypeSymlink + const PacketTypeV6Block + const PacketTypeV6Link + const PacketTypeV6Unblock + const PacketTypeVersion + const PacketTypeWrite + const StatusBadMessage + const StatusConnectionLost + const StatusEOF + const StatusFailure + const StatusNoConnection + const StatusNoSuchFile + const StatusOK + const StatusOPUnsupported + const StatusPermissionDenied + const StatusV4FileAlreadyExists + const StatusV4InvalidHandle + const StatusV4NoMedia + const StatusV4NoSuchPath + const StatusV4WriteProtect + const StatusV5LockConflict + const StatusV5NoSpaceOnFilesystem + const StatusV5QuotaExceeded + const StatusV5UnknownPrincipal + const StatusV6ByteRangeLockConflict + const StatusV6ByteRangeLockRefused + const StatusV6CannotDelete + const StatusV6DeletePending + const StatusV6DirNotEmpty + const StatusV6FileCorrupt + const StatusV6FileIsADirectory + const StatusV6GroupInvalid + const StatusV6InvalidFilename + const StatusV6InvalidParameter + const StatusV6LinkLoop + const StatusV6NoMatchingByteRangeLock + const StatusV6NotADirectory + const StatusV6OwnerInvalid + var ErrLongPacket = errors.New("packet too long") + var ErrShortPacket = errors.New("packet too short") + func ComposePacket(header, payload []byte, err error) ([]byte, error) + func RegisterExtendedPacketType(extension string, constructor ExtendedDataConstructor) + type Attributes struct + ATime uint32 + ExtendedAttributes []ExtendedAttribute + Flags uint32 + GID uint32 + MTime uint32 + Permissions FileMode + Size uint64 + UID uint32 + func (a *Attributes) GetACModTime() (atime, mtime uint32, ok bool) + func (a *Attributes) GetPermissions() (perms FileMode, ok bool) + func (a *Attributes) GetSize() (size uint64, ok bool) + func (a *Attributes) GetUIDGID() (uid, gid uint32, ok bool) + func (a *Attributes) Len() int + func (a *Attributes) MarshalBinary() ([]byte, error) + func (a *Attributes) MarshalInto(b *Buffer) + func (a *Attributes) SetACModTime(atime, mtime uint32) + func (a *Attributes) SetPermissions(perms FileMode) + func (a *Attributes) SetSize(size uint64) + func (a *Attributes) SetUIDGID(uid, gid uint32) + func (a *Attributes) UnmarshalBinary(data []byte) error + func (a *Attributes) UnmarshalFrom(b *Buffer) (err error) + func (a *Attributes) XXX_UnmarshalByFlags(flags uint32, b *Buffer) (err error) + type AttrsPacket struct + Attrs Attributes + func (p *AttrsPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *AttrsPacket) Type() PacketType + func (p *AttrsPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type Buffer struct + func NewBuffer(buf []byte) *Buffer + func NewMarshalBuffer(size int) *Buffer + func (b *Buffer) AppendBool(v bool) + func (b *Buffer) AppendByteSlice(v []byte) + func (b *Buffer) AppendInt64(v int64) + func (b *Buffer) AppendString(v string) + func (b *Buffer) AppendUint16(v uint16) + func (b *Buffer) AppendUint32(v uint32) + func (b *Buffer) AppendUint64(v uint64) + func (b *Buffer) AppendUint8(v uint8) + func (b *Buffer) Bytes() []byte + func (b *Buffer) Cap() int + func (b *Buffer) ConsumeBool() (bool, error) + func (b *Buffer) ConsumeByteSlice() ([]byte, error) + func (b *Buffer) ConsumeInt64() (int64, error) + func (b *Buffer) ConsumeString() (string, error) + func (b *Buffer) ConsumeUint16() (uint16, error) + func (b *Buffer) ConsumeUint32() (uint32, error) + func (b *Buffer) ConsumeUint64() (uint64, error) + func (b *Buffer) ConsumeUint8() (uint8, error) + func (b *Buffer) Len() int + func (b *Buffer) MarshalBinary() ([]byte, error) + func (b *Buffer) Packet(payload []byte) (header, payloadPassThru []byte, err error) + func (b *Buffer) PutLength(size int) + func (b *Buffer) Reset() + func (b *Buffer) StartPacket(packetType PacketType, requestID uint32) + func (b *Buffer) UnmarshalBinary(data []byte) error + type ClosePacket struct + Handle string + func (p *ClosePacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *ClosePacket) Type() PacketType + func (p *ClosePacket) UnmarshalPacketBody(buf *Buffer) (err error) + type DataPacket struct + Data []byte + func (p *DataPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *DataPacket) Type() PacketType + func (p *DataPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type ExtendedAttribute struct + Data string + Type string + func (e *ExtendedAttribute) Len() int + func (e *ExtendedAttribute) MarshalBinary() ([]byte, error) + func (e *ExtendedAttribute) MarshalInto(b *Buffer) + func (e *ExtendedAttribute) UnmarshalBinary(data []byte) error + func (e *ExtendedAttribute) UnmarshalFrom(b *Buffer) (err error) + type ExtendedData = interface + type ExtendedDataConstructor func() ExtendedData + type ExtendedPacket struct + Data ExtendedData + ExtendedRequest string + func (p *ExtendedPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *ExtendedPacket) Type() PacketType + func (p *ExtendedPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type ExtendedReplyPacket struct + Data ExtendedData + func (p *ExtendedReplyPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *ExtendedReplyPacket) Type() PacketType + func (p *ExtendedReplyPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type ExtensionPair struct + Data string + Name string + func (e *ExtensionPair) Len() int + func (e *ExtensionPair) MarshalBinary() ([]byte, error) + func (e *ExtensionPair) MarshalInto(buf *Buffer) + func (e *ExtensionPair) UnmarshalBinary(data []byte) error + func (e *ExtensionPair) UnmarshalFrom(buf *Buffer) (err error) + type FSetstatPacket struct + Attrs Attributes + Handle string + func (p *FSetstatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *FSetstatPacket) Type() PacketType + func (p *FSetstatPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type FStatPacket struct + Handle string + func (p *FStatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *FStatPacket) Type() PacketType + func (p *FStatPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type FileMode uint32 + const ModeCharDevice + const ModeDevice + const ModeDir + const ModeGroupExec + const ModeGroupRead + const ModeGroupWrite + const ModeNamedPipe + const ModeOtherExec + const ModeOtherRead + const ModeOtherWrite + const ModePerm + const ModeRegular + const ModeSetGID + const ModeSetUID + const ModeSocket + const ModeSticky + const ModeSymlink + const ModeType + const ModeUserExec + const ModeUserRead + const ModeUserWrite + func (m FileMode) IsDir() bool + func (m FileMode) IsRegular() bool + func (m FileMode) Perm() FileMode + func (m FileMode) String() string + func (m FileMode) Type() FileMode + type HandlePacket struct + Handle string + func (p *HandlePacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *HandlePacket) Type() PacketType + func (p *HandlePacket) UnmarshalPacketBody(buf *Buffer) (err error) + type InitPacket struct + Extensions []*ExtensionPair + Version uint32 + func (p *InitPacket) MarshalBinary() ([]byte, error) + func (p *InitPacket) UnmarshalBinary(data []byte) (err error) + type LStatPacket struct + Path string + func (p *LStatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *LStatPacket) Type() PacketType + func (p *LStatPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type MkdirPacket struct + Attrs Attributes + Path string + func (p *MkdirPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *MkdirPacket) Type() PacketType + func (p *MkdirPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type NameEntry struct + Attrs Attributes + Filename string + Longname string + func (e *NameEntry) Len() int + func (e *NameEntry) MarshalBinary() ([]byte, error) + func (e *NameEntry) MarshalInto(b *Buffer) + func (e *NameEntry) UnmarshalBinary(data []byte) error + func (e *NameEntry) UnmarshalFrom(b *Buffer) (err error) + type NamePacket struct + Entries []*NameEntry + func (p *NamePacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *NamePacket) Type() PacketType + func (p *NamePacket) UnmarshalPacketBody(buf *Buffer) (err error) + type OpenDirPacket struct + Path string + func (p *OpenDirPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *OpenDirPacket) Type() PacketType + func (p *OpenDirPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type OpenPacket struct + Attrs Attributes + Filename string + PFlags uint32 + func (p *OpenPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *OpenPacket) Type() PacketType + func (p *OpenPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type Packet interface + Type func() PacketType + UnmarshalPacketBody func(buf *Buffer) error + type PacketMarshaller interface + MarshalPacket func(reqid uint32, b []byte) (header, payload []byte, err error) + type PacketType uint8 + func (f PacketType) String() string + type RawPacket struct + Data Buffer + PacketType PacketType + RequestID uint32 + func (p *RawPacket) MarshalBinary() ([]byte, error) + func (p *RawPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *RawPacket) ReadFrom(r io.Reader, b []byte, maxPacketLength uint32) error + func (p *RawPacket) Reset() + func (p *RawPacket) Type() PacketType + func (p *RawPacket) UnmarshalBinary(data []byte) error + func (p *RawPacket) UnmarshalFrom(buf *Buffer) error + type ReadDirPacket struct + Handle string + func (p *ReadDirPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *ReadDirPacket) Type() PacketType + func (p *ReadDirPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type ReadLinkPacket struct + Path string + func (p *ReadLinkPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *ReadLinkPacket) Type() PacketType + func (p *ReadLinkPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type ReadPacket struct + Handle string + Len uint32 + Offset uint64 + func (p *ReadPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *ReadPacket) Type() PacketType + func (p *ReadPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type RealPathPacket struct + Path string + func (p *RealPathPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *RealPathPacket) Type() PacketType + func (p *RealPathPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type RemovePacket struct + Path string + func (p *RemovePacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *RemovePacket) Type() PacketType + func (p *RemovePacket) UnmarshalPacketBody(buf *Buffer) (err error) + type RenamePacket struct + NewPath string + OldPath string + func (p *RenamePacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *RenamePacket) Type() PacketType + func (p *RenamePacket) UnmarshalPacketBody(buf *Buffer) (err error) + type RequestPacket struct + Request Packet + RequestID uint32 + func (p *RequestPacket) MarshalBinary() ([]byte, error) + func (p *RequestPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *RequestPacket) ReadFrom(r io.Reader, b []byte, maxPacketLength uint32) error + func (p *RequestPacket) Reset() + func (p *RequestPacket) Type() PacketType + func (p *RequestPacket) UnmarshalBinary(data []byte) error + func (p *RequestPacket) UnmarshalFrom(buf *Buffer) error + type RmdirPacket struct + Path string + func (p *RmdirPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *RmdirPacket) Type() PacketType + func (p *RmdirPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type SetstatPacket struct + Attrs Attributes + Path string + func (p *SetstatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *SetstatPacket) Type() PacketType + func (p *SetstatPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type StatPacket struct + Path string + func (p *StatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *StatPacket) Type() PacketType + func (p *StatPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type Status uint32 + func (s Status) Error() string + func (s Status) Is(target error) bool + func (s Status) String() string + type StatusPacket struct + ErrorMessage string + LanguageTag string + StatusCode Status + func (p *StatusPacket) Error() string + func (p *StatusPacket) Is(target error) bool + func (p *StatusPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *StatusPacket) Type() PacketType + func (p *StatusPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type SymlinkPacket struct + LinkPath string + TargetPath string + func (p *SymlinkPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *SymlinkPacket) Type() PacketType + func (p *SymlinkPacket) UnmarshalPacketBody(buf *Buffer) (err error) + type VersionPacket struct + Extensions []*ExtensionPair + Version uint32 + func (p *VersionPacket) MarshalBinary() ([]byte, error) + func (p *VersionPacket) UnmarshalBinary(data []byte) (err error) + type WritePacket struct + Data []byte + Handle string + Offset uint64 + func (p *WritePacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) + func (p *WritePacket) Type() PacketType + func (p *WritePacket) UnmarshalPacketBody(buf *Buffer) (err error)