pkg

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api interface {
	Sign() error

	Space() (Space, error)

	Login(name, password string) error

	Find(id, name string) (File, error)

	FindDir(id, name string) (File, error)

	FindFile(id, name string) (File, error)

	Detail(id string) (File, error)

	ListFile(id string) ([]File, error)

	Mkdir(parentId, path string, parents bool) error

	Mkdirs(parentId string, path ...string) (map[string]interface{}, error)

	Copy(taget string, src ...File) error

	Move(taget string, src ...File) error

	Delete(src ...File) error

	Rename(file File, newName string) error

	Download(file File, start int64) (*http.Response, error)

	Uploader
}

type App

type App interface {
	Uploader() Uploader

	Login(name, password string) error

	Sign() error

	Space() (Space, error)

	Stat(path string) (File, error)

	List(file File) ([]File, error)

	ListBy(name string) ([]File, error)

	Mkdir(path string, parents bool) error

	Mkdirs(path ...string) error

	Copy(target string, from ...string) error

	Move(target string, from ...string) error

	Remove(paths ...string) error

	Download(local string, paths ...string) error

	DownloadFile(local string, file File) error

	Upload(cloud string, locals ...string) error
}

type File

type File interface {
	Id() string
	PId() string
	os.FileInfo
}

type FileExt

type FileExt struct {
	FileCount   int64
	CreateTime  time.Time
	DownloadUrl string
}

type Space

type Space struct {
	Available uint64 `json:"available,omitempty"`
	Capacity  uint64 `json:"capacity,omitempty"`
}

type UploadFile

type UploadFile interface {
	Prepare(init func())
	ParentId() string
	Name() string
	Size() int64
	SliceNum() int
	FileMD5() string
	SliceMD5() string
	IsExists() bool
	Type() string
	IsComplete() bool
	UploadId() string
	Overwrite() bool
	SetExists(exists bool)
	SetUploadId(uploadId string)
}

type UploadPart

type UploadPart interface {
	Num() int
	Name() string
	Data() io.Reader
}

type Uploader

type Uploader interface {
	Upload(file UploadFile, part UploadPart) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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