adrive

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const ALIYUNDRIVE_HOST = "https://www.aliyundrive.com"

Variables

View Source
var ErrMaxWriteByteExceed = fmt.Errorf("exceed max write byte")

Functions

This section is empty.

Types

type AlipanConfig added in v0.2.0

type AlipanConfig struct {
	RootDir string `json:"rootDir" yaml:"rootDir"` // 根目录

	Readonly bool `json:"readonly" yaml:"readonly"` // 只读模式

	ClientId     string `json:"clientId" yaml:"clientId"`
	ClientSecret string `json:"clientSecret" yaml:"clientSecret"`
}

type Config added in v0.2.0

type Config struct {
	AlipanConfig AlipanConfig `json:"alipan" yaml:"alipan"`
}

func Get added in v0.2.0

func Get() *Config

type FileInfo added in v0.2.0

type FileInfo struct {
	*alipanopen.File
	// contains filtered or unexported fields
}

func NewFileInfo added in v0.2.0

func NewFileInfo(file *alipanopen.File, fileMode fs.FileMode) *FileInfo

func (*FileInfo) IsDir added in v0.2.0

func (f *FileInfo) IsDir() bool

func (*FileInfo) ModTime added in v0.2.0

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

func (*FileInfo) Mode added in v0.2.0

func (f *FileInfo) Mode() fs.FileMode

func (*FileInfo) Name added in v0.2.0

func (f *FileInfo) Name() string

func (*FileInfo) Size added in v0.2.0

func (f *FileInfo) Size() int64

func (*FileInfo) Sys added in v0.2.0

func (f *FileInfo) Sys() any

type FileSystem

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

func NewFileSystem

func NewFileSystem(config AlipanConfig) (*FileSystem, error)

func (*FileSystem) Mkdir

func (fs *FileSystem) Mkdir(ctx context.Context, name string, perm os.FileMode) (err error)

func (*FileSystem) OpenFile

func (fs *FileSystem) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (result webdav.File, err error)

func (*FileSystem) RemoveAll

func (fs *FileSystem) RemoveAll(ctx context.Context, name string) (err error)

func (*FileSystem) Rename

func (fs *FileSystem) Rename(ctx context.Context, oldName, newName string) (err error)

func (*FileSystem) Stat

func (fs *FileSystem) Stat(ctx context.Context, name string) (fi os.FileInfo, err error)

type ReadableFile added in v0.2.0

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

func NewReadableFile added in v0.2.0

func NewReadableFile(fi *FileInfo, fs *FileSystem) *ReadableFile

func (*ReadableFile) Close added in v0.2.0

func (readableFile *ReadableFile) Close() error

func (*ReadableFile) Read added in v0.2.0

func (readableFile *ReadableFile) Read(p []byte) (n int, err error)

func (*ReadableFile) Readdir added in v0.2.0

func (readableFile *ReadableFile) Readdir(count int) (result []fs.FileInfo, err error)

func (*ReadableFile) Seek added in v0.2.0

func (readableFile *ReadableFile) Seek(offset int64, whence int) (int64, error)

func (*ReadableFile) Stat added in v0.2.0

func (readableFile *ReadableFile) Stat() (fi fs.FileInfo, err error)

func (*ReadableFile) Write added in v0.2.0

func (readableFile *ReadableFile) Write(p []byte) (n int, err error)

type Uploader

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

func NewUploader

func NewUploader(uploadUrl string, maxWriteBytes int64) (*Uploader, error)

func (*Uploader) CloseAndWait

func (u *Uploader) CloseAndWait() error

func (*Uploader) Write

func (u *Uploader) Write(p []byte) (n int, err error)

type WritableFile added in v0.2.0

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

func NewWritableFile added in v0.2.0

func NewWritableFile(fi *FileInfo, fs *FileSystem) (*WritableFile, error)

func (*WritableFile) Close added in v0.2.0

func (writableFile *WritableFile) Close() (err error)

func (*WritableFile) Read added in v0.2.0

func (writableFile *WritableFile) Read(p []byte) (n int, err error)

func (*WritableFile) Readdir added in v0.2.0

func (writableFile *WritableFile) Readdir(count int) ([]fs.FileInfo, error)

func (*WritableFile) Seek added in v0.2.0

func (writableFile *WritableFile) Seek(offset int64, whence int) (int64, error)

func (*WritableFile) Stat added in v0.2.0

func (writableFile *WritableFile) Stat() (fs.FileInfo, error)

func (*WritableFile) Write added in v0.2.0

func (writableFile *WritableFile) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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