Documentation
¶
Index ¶
- Constants
- func A(n int32, t int32, e int32, a int32, r int32, i int32, l int32) int32
- func C(n int32, t int32, e int32, a int32, r int32, i int32, l int32) int32
- func CalcProofOffset(accessToken string, fileSize int64) int64
- func CalcSha1(in *os.File) (*os.File, string, error)
- func D(n string) []int32
- func F(n string) string
- func G(n string) string
- func H(n string) string
- func I(n int32, t int32) int32
- func L(n int32, t int32, e int32, a int32, r int32, i int32, l int32) int32
- func O(n int32, t int32, e int32, a int32, r int32, o int32) int32
- func P(n []int32, t int32) []int32
- func S(n int32, t int32, e int32, a int32, r int32, i int32, l int32) int32
- func U(n []int32) string
- type AlbumInfo
- type Config
- type DownloadUrl
- type Drive
- func (drive *Drive) CalcProof(fileSize int64, in *os.File) (*os.File, string, error)
- func (drive *Drive) Copy(ctx context.Context, node *Node, dstParent *Node, dstName string) error
- func (drive *Drive) CreateFile(ctx context.Context, fullPath string, size int64, in io.Reader, overwrite bool) (*Node, error)
- func (drive *Drive) CreateFileWithProof(ctx context.Context, fullPath string, size int64, in io.Reader, ...) (*Node, error)
- func (drive *Drive) CreateFolder(ctx context.Context, fullPath string) (*Node, error)
- func (drive *Drive) Get(ctx context.Context, fullPath string, kind string) (*Node, error)
- func (drive *Drive) List(ctx context.Context, fullPath string) ([]Node, error)
- func (drive *Drive) Move(ctx context.Context, node *Node, dstParent *Node, dstName string) error
- func (drive *Drive) Open(ctx context.Context, node *Node, headers map[string]string) (io.ReadCloser, error)
- func (drive *Drive) Remove(ctx context.Context, node *Node) error
- func (drive *Drive) Rename(ctx context.Context, node *Node, newName string) error
- func (drive *Drive) String() string
- type FileProof
- type Fs
- type ListNodes
- type Node
- type PartInfo
- type ProofResult
- type Token
- type User
Constants ¶
View Source
const ( FolderKind = "folder" FileKind = "file" AnyKind = "any" )
View Source
const (
MaxPartSize = 1024 * 1024 * 1024 // 1G
)
Variables ¶
This section is empty.
Functions ¶
func CalcProofOffset ¶
Types ¶
type AlbumInfo ¶
type AlbumInfo struct {
Data struct {
DriveId string `json:"driveId"`
} `json:"data"`
}
type DownloadUrl ¶
type Drive ¶
type Drive struct {
// contains filtered or unexported fields
}
func (*Drive) CreateFile ¶
func (*Drive) CreateFileWithProof ¶
func (*Drive) CreateFolder ¶
type FileProof ¶
type FileProof struct {
DriveID string `json:"drive_id"`
PartInfoList []*PartInfo `json:"part_info_list"`
ParentFileID string `json:"parent_file_id"`
Name string `json:"name"`
Type string `json:"type"`
CheckNameMode string `json:"check_name_mode"`
Size int64 `json:"size"`
ContentHash string `json:"content_hash"`
ContentHashName string `json:"content_hash_name"`
ProofCode string `json:"proof_code"`
ProofVersion string `json:"proof_version"`
}
type Fs ¶
type Fs interface {
Get(ctx context.Context, fullPath string, kind string) (*Node, error)
List(ctx context.Context, fullPath string) ([]Node, error)
CreateFolder(ctx context.Context, fullPath string) (*Node, error)
Rename(ctx context.Context, node *Node, newName string) error
Move(ctx context.Context, node *Node, dstParent *Node, dstName string) error
Remove(ctx context.Context, node *Node) error
Open(ctx context.Context, node *Node, headers map[string]string) (io.ReadCloser, error)
CreateFile(ctx context.Context, fullPath string, size int64, in io.Reader, overwrite bool) (*Node, error)
CalcProof(fileSize int64, in *os.File) (*os.File, string, error)
CreateFileWithProof(ctx context.Context, fullPath string, size int64, in io.Reader, sha1Code string, proofCode string, overwrite bool) (*Node, error)
Copy(ctx context.Context, node *Node, dstParent *Node, dstName string) error
}
type Node ¶
type Node struct {
DownloadUrl string `json:"download_url,omitempty"`
Type string `json:"type"` // folder | file
Hash string `json:"content_hash,omitempty"` // sha1
Name string `json:"name"`
NodeId string `json:"file_id"`
ParentId string `json:"parent_file_id,omitempty"`
Size int64 `json:"size,omitempty"`
Updated string `json:"updated_at"`
}
func (*Node) IsDirectory ¶
type ProofResult ¶
Click to show internal directories.
Click to hide internal directories.