client

package
v0.0.0-...-f427959 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoxBackup

type BoxBackup struct {
	// contains filtered or unexported fields
}

func NewBoxBackup

func NewBoxBackup(srv net.Conn, crypt *crypto.Crypto) *BoxBackup

func (*BoxBackup) CheckVersion

func (b *BoxBackup) CheckVersion(version int32) error

func (*BoxBackup) CreateFile

func (b *BoxBackup) CreateFile(curDir int64, name string) (*RemoteFile, error)

func (*BoxBackup) DeleteFile

func (b *BoxBackup) DeleteFile(d int64, fn string) error

func (*BoxBackup) Execute

func (b *BoxBackup) Execute(op *Operation) (interface{}, error)

Takes one of the structures defined in proto.go and writes them to the wire, gets reponse from the server and packs it into an appropriate struct.

func (*BoxBackup) Finish

func (b *BoxBackup) Finish() error

func (*BoxBackup) GetAccountUsage

func (b *BoxBackup) GetAccountUsage() error

func (*BoxBackup) GetBlockIndexByID

func (b *BoxBackup) GetBlockIndexByID(id int64) error

func (*BoxBackup) GetBlockIndexByName

func (b *BoxBackup) GetBlockIndexByName(d int64, fn string) error

func (*BoxBackup) GetFile

func (b *BoxBackup) GetFile(d, id int64) (*RemoteFile, error)

func (*BoxBackup) GetObject

func (b *BoxBackup) GetObject(id int64) (*RemoteFile, error)

func (*BoxBackup) GetObjectName

func (b *BoxBackup) GetObjectName(d, id int64) ([]string, error)

func (*BoxBackup) GetStream

func (b *BoxBackup) GetStream() (*Stream, error)

func (*BoxBackup) HandleError

func (b *BoxBackup) HandleError(ret *proto.Error) error

func (*BoxBackup) Login

func (b *BoxBackup) Login(user int32, ro bool) error

func (*BoxBackup) OpenFile

func (b *BoxBackup) OpenFile(curDir, id int64) (*RemoteFile, error)

func (*BoxBackup) ReadDir

func (b *BoxBackup) ReadDir(id int64) ([]*RemoteFile, error)

func (*BoxBackup) StoreFile

func (b *BoxBackup) StoreFile(d, m, a int64, fn string, fc []byte) error

type Config

type Config struct {
	Strings map[string]string
	Values  map[string]uint32
}

func NewConfig

func NewConfig(n string) (*Config, error)

type Operation

type Operation struct {
	Op     interface{}
	Tail   []byte        // For variable trailers
	Stream *bytes.Buffer // Follow up with this stream
}

type RemoteFile

type RemoteFile struct {
	Id       int64
	ParentId int64

	UID uint32
	GID uint32

	Flags                int16
	ModificationTime     time.Time
	AttributesModTime    time.Time
	FileGenerationNumber uint32

	Symlink string
	// contains filtered or unexported fields
}

RemoteFile structure implements os.FileInfo interface.

func (*RemoteFile) Close

func (f *RemoteFile) Close() error

func (*RemoteFile) Commit

func (f *RemoteFile) Commit() error

func (*RemoteFile) IsDir

func (f *RemoteFile) IsDir() bool

abbreviation for Mode().IsDir()

func (*RemoteFile) ModTime

func (f *RemoteFile) ModTime() time.Time

modification time

func (*RemoteFile) Mode

func (f *RemoteFile) Mode() os.FileMode

file mode bits

func (*RemoteFile) Name

func (f *RemoteFile) Name() string

Base name of the file

func (*RemoteFile) Read

func (f *RemoteFile) Read(p []byte) (int, error)

func (*RemoteFile) Size

func (f *RemoteFile) Size() int64

length in bytes for regular files; system-dependent for others

func (*RemoteFile) Sys

func (f *RemoteFile) Sys() interface{}

underlying data source (can return nil)

func (*RemoteFile) Write

func (f *RemoteFile) Write(p []byte) (int, error)

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func (*Stream) Peek

func (s *Stream) Peek(i int) ([]byte, error)

func (*Stream) Read

func (s *Stream) Read(p []byte) (int, error)

func (*Stream) Remaining

func (s *Stream) Remaining() uint32

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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