Versions in this module Expand all Collapse all v0 v0.12.1 Oct 23, 2015 Changes in this version + const BlockSize + const FlagDeleted + const FlagDirectory + const FlagIndexTemporary + const FlagIntroducer + const FlagInvalid + const FlagNoPermBits + const FlagRequestTemporary + const FlagShareBits + const FlagShareReadOnly + const FlagShareTrusted + const FlagSymlink + const FlagSymlinkMissingTarget + const FlagsAll + const MaxMessageLen + const PingSendInterval + const ReceiveTimeout + const SymlinkTypeMask + var ErrClosed = errors.New("connection closed") + var ErrGeneric = errors.New("generic error") + var ErrInvalid = errors.New("file is invalid") + var ErrNoError error = nil + var ErrNoSuchFile = errors.New("no such file") + var ErrTimeout = errors.New("read timeout") + var LocalDeviceID = DeviceID + func TotalInOut() (int64, int64) + type BlockInfo struct + Hash []byte + Offset int64 + Size int32 + func (b BlockInfo) String() string + func (o *BlockInfo) DecodeXDR(r io.Reader) error + func (o *BlockInfo) DecodeXDRFrom(xr *xdr.Reader) error + func (o *BlockInfo) UnmarshalXDR(bs []byte) error + func (o BlockInfo) AppendXDR(bs []byte) ([]byte, error) + func (o BlockInfo) EncodeXDR(w io.Writer) (int, error) + func (o BlockInfo) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o BlockInfo) MarshalXDR() ([]byte, error) + func (o BlockInfo) MustMarshalXDR() []byte + type CloseMessage struct + Code int32 + Reason string + func (o *CloseMessage) DecodeXDR(r io.Reader) error + func (o *CloseMessage) DecodeXDRFrom(xr *xdr.Reader) error + func (o *CloseMessage) UnmarshalXDR(bs []byte) error + func (o CloseMessage) AppendXDR(bs []byte) ([]byte, error) + func (o CloseMessage) EncodeXDR(w io.Writer) (int, error) + func (o CloseMessage) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o CloseMessage) MarshalXDR() ([]byte, error) + func (o CloseMessage) MustMarshalXDR() []byte + type ClusterConfigMessage struct + ClientName string + ClientVersion string + Folders []Folder + Options []Option + func (o *ClusterConfigMessage) DecodeXDR(r io.Reader) error + func (o *ClusterConfigMessage) DecodeXDRFrom(xr *xdr.Reader) error + func (o *ClusterConfigMessage) GetOption(key string) string + func (o *ClusterConfigMessage) UnmarshalXDR(bs []byte) error + func (o ClusterConfigMessage) AppendXDR(bs []byte) ([]byte, error) + func (o ClusterConfigMessage) EncodeXDR(w io.Writer) (int, error) + func (o ClusterConfigMessage) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o ClusterConfigMessage) MarshalXDR() ([]byte, error) + func (o ClusterConfigMessage) MustMarshalXDR() []byte + type Compression int + const CompressAlways + const CompressMetadata + const CompressNever + func (c *Compression) UnmarshalText(bs []byte) error + func (c Compression) GoString() string + func (c Compression) MarshalText() ([]byte, error) + func (c Compression) String() string + type Connection interface + ClusterConfig func(config ClusterConfigMessage) + ID func() DeviceID + Index func(folder string, files []FileInfo, flags uint32, options []Option) error + IndexUpdate func(folder string, files []FileInfo, flags uint32, options []Option) error + Name func() string + Request func(folder string, name string, offset int64, size int, hash []byte, flags uint32, ...) ([]byte, error) + Start func() + Statistics func() Statistics + func NewConnection(deviceID DeviceID, reader io.Reader, writer io.Writer, receiver Model, ...) Connection + type Counter struct + ID uint64 + Value uint64 + type Device struct + Flags uint32 + ID []byte + MaxLocalVersion int64 + Options []Option + func (o *Device) DecodeXDR(r io.Reader) error + func (o *Device) DecodeXDRFrom(xr *xdr.Reader) error + func (o *Device) UnmarshalXDR(bs []byte) error + func (o Device) AppendXDR(bs []byte) ([]byte, error) + func (o Device) EncodeXDR(w io.Writer) (int, error) + func (o Device) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o Device) MarshalXDR() ([]byte, error) + func (o Device) MustMarshalXDR() []byte + type DeviceID [32]byte + func DeviceIDFromBytes(bs []byte) DeviceID + func DeviceIDFromString(s string) (DeviceID, error) + func NewDeviceID(rawCert []byte) DeviceID + func (n *DeviceID) MarshalText() ([]byte, error) + func (n *DeviceID) UnmarshalText(bs []byte) error + func (n DeviceID) Compare(other DeviceID) int + func (n DeviceID) Equals(other DeviceID) bool + func (n DeviceID) GoString() string + func (n DeviceID) Short() uint64 + func (n DeviceID) String() string + type EmptyMessage struct + func (o *EmptyMessage) DecodeXDR(r io.Reader) error + func (o *EmptyMessage) DecodeXDRFrom(xr *xdr.Reader) error + func (o *EmptyMessage) UnmarshalXDR(bs []byte) error + func (o EmptyMessage) AppendXDR(bs []byte) ([]byte, error) + func (o EmptyMessage) EncodeXDR(w io.Writer) (int, error) + func (o EmptyMessage) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o EmptyMessage) MarshalXDR() ([]byte, error) + func (o EmptyMessage) MustMarshalXDR() []byte + type FileInfo struct + Blocks []BlockInfo + CachedSize int64 + Flags uint32 + LocalVersion int64 + Modified int64 + Name string + Version Vector + func (f FileInfo) HasPermissionBits() bool + func (f FileInfo) IsDeleted() bool + func (f FileInfo) IsDirectory() bool + func (f FileInfo) IsInvalid() bool + func (f FileInfo) IsSymlink() bool + func (f FileInfo) Size() (bytes int64) + func (f FileInfo) String() string + func (f FileInfo) WinsConflict(other FileInfo) bool + func (o *FileInfo) DecodeXDR(r io.Reader) error + func (o *FileInfo) DecodeXDRFrom(xr *xdr.Reader) error + func (o *FileInfo) UnmarshalXDR(bs []byte) error + func (o FileInfo) AppendXDR(bs []byte) ([]byte, error) + func (o FileInfo) EncodeXDR(w io.Writer) (int, error) + func (o FileInfo) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o FileInfo) MarshalXDR() ([]byte, error) + func (o FileInfo) MustMarshalXDR() []byte + type Folder struct + Devices []Device + Flags uint32 + ID string + Options []Option + func (o *Folder) DecodeXDR(r io.Reader) error + func (o *Folder) DecodeXDRFrom(xr *xdr.Reader) error + func (o *Folder) UnmarshalXDR(bs []byte) error + func (o Folder) AppendXDR(bs []byte) ([]byte, error) + func (o Folder) EncodeXDR(w io.Writer) (int, error) + func (o Folder) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o Folder) MarshalXDR() ([]byte, error) + func (o Folder) MustMarshalXDR() []byte + type IndexMessage struct + Files []FileInfo + Flags uint32 + Folder string + Options []Option + func (o *IndexMessage) DecodeXDR(r io.Reader) error + func (o *IndexMessage) DecodeXDRFrom(xr *xdr.Reader) error + func (o *IndexMessage) UnmarshalXDR(bs []byte) error + func (o IndexMessage) AppendXDR(bs []byte) ([]byte, error) + func (o IndexMessage) EncodeXDR(w io.Writer) (int, error) + func (o IndexMessage) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o IndexMessage) MarshalXDR() ([]byte, error) + func (o IndexMessage) MustMarshalXDR() []byte + type Model interface + Close func(deviceID DeviceID, err error) + ClusterConfig func(deviceID DeviceID, config ClusterConfigMessage) + Index func(deviceID DeviceID, folder string, files []FileInfo, flags uint32, ...) + IndexUpdate func(deviceID DeviceID, folder string, files []FileInfo, flags uint32, ...) + Request func(deviceID DeviceID, folder string, name string, offset int64, hash []byte, ...) error + type Option struct + Key string + Value string + func (o *Option) DecodeXDR(r io.Reader) error + func (o *Option) DecodeXDRFrom(xr *xdr.Reader) error + func (o *Option) UnmarshalXDR(bs []byte) error + func (o Option) AppendXDR(bs []byte) ([]byte, error) + func (o Option) EncodeXDR(w io.Writer) (int, error) + func (o Option) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o Option) MarshalXDR() ([]byte, error) + func (o Option) MustMarshalXDR() []byte + type Ordering int + const ConcurrentGreater + const ConcurrentLesser + const Equal + const Greater + const Lesser + type RequestMessage struct + Flags uint32 + Folder string + Hash []byte + Name string + Offset int64 + Options []Option + Size int32 + func (o *RequestMessage) DecodeXDR(r io.Reader) error + func (o *RequestMessage) DecodeXDRFrom(xr *xdr.Reader) error + func (o *RequestMessage) UnmarshalXDR(bs []byte) error + func (o RequestMessage) AppendXDR(bs []byte) ([]byte, error) + func (o RequestMessage) EncodeXDR(w io.Writer) (int, error) + func (o RequestMessage) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o RequestMessage) MarshalXDR() ([]byte, error) + func (o RequestMessage) MustMarshalXDR() []byte + type ResponseMessage struct + Code int32 + Data []byte + func (o *ResponseMessage) DecodeXDR(r io.Reader) error + func (o *ResponseMessage) DecodeXDRFrom(xr *xdr.Reader) error + func (o *ResponseMessage) UnmarshalXDR(bs []byte) error + func (o ResponseMessage) AppendXDR(bs []byte) ([]byte, error) + func (o ResponseMessage) EncodeXDR(w io.Writer) (int, error) + func (o ResponseMessage) EncodeXDRInto(xw *xdr.Writer) (int, error) + func (o ResponseMessage) MarshalXDR() ([]byte, error) + func (o ResponseMessage) MustMarshalXDR() []byte + type Statistics struct + At time.Time + InBytesTotal int64 + OutBytesTotal int64 + type Vector []Counter + func (a Vector) Compare(b Vector) Ordering + func (a Vector) Concurrent(b Vector) bool + func (a Vector) Equal(b Vector) bool + func (a Vector) GreaterEqual(b Vector) bool + func (a Vector) LesserEqual(b Vector) bool + func (a Vector) Merge(b Vector) Vector + func (v *Vector) DecodeXDRFrom(r xdrReader) error + func (v Vector) Copy() Vector + func (v Vector) Counter(id uint64) uint64 + func (v Vector) EncodeXDRInto(w xdrWriter) (int, error) + func (v Vector) Update(ID uint64) Vector