teldrive

package
v4.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: AGPL-3.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addition

type Addition struct {
	driver.RootPath
	Address           string `json:"url" required:"true"`
	Cookie            string `json:"cookie" type:"string" required:"true" help:"access_token=xxx"`
	UseShareLink      bool   `` /* 151-byte string literal not displayed */
	ChunkSize         int64  `json:"chunk_size" type:"number" default:"10" help:"Chunk size in MiB"`
	UploadConcurrency int64  `json:"upload_concurrency" type:"number" default:"4" help:"Concurrency upload requests"`
}

type CopyManager

type CopyManager struct {
	TaskChan chan CopyTask
	Sem      *semaphore.Weighted
	G        *errgroup.Group
	Ctx      context.Context
	// contains filtered or unexported fields
}

func NewCopyManager

func NewCopyManager(ctx context.Context, concurrent int, d *Teldrive) *CopyManager

type CopyTask

type CopyTask struct {
	SrcObj model.Obj
	DstDir model.Obj
}

type ErrResp

type ErrResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func (*ErrResp) Error

func (err *ErrResp) Error() string

type FilePart

type FilePart struct {
	Name      string `json:"name"`
	PartId    int    `json:"partId"`
	PartNo    int    `json:"partNo"`
	ChannelId int    `json:"channelId"`
	Size      int    `json:"size"`
	Encrypted bool   `json:"encrypted"`
	Salt      string `json:"salt"`
}

type ListResp

type ListResp struct {
	Items []Object `json:"items"`
	Meta  struct {
		Count       int `json:"count"`
		TotalPages  int `json:"totalPages"`
		CurrentPage int `json:"currentPage"`
	} `json:"meta"`
}

type Object

type Object struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Type      string    `json:"type"`
	MimeType  string    `json:"mimeType"`
	Category  string    `json:"category,omitempty"`
	ParentId  string    `json:"parentId"`
	Size      int64     `json:"size"`
	Encrypted bool      `json:"encrypted"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type ShareObj

type ShareObj struct {
	Id        string    `json:"id"`
	Protected bool      `json:"protected"`
	UserId    int       `json:"userId"`
	Type      string    `json:"type"`
	Name      string    `json:"name"`
	ExpiresAt time.Time `json:"expiresAt"`
}

type Teldrive

type Teldrive struct {
	model.Storage
	Addition
}

func (*Teldrive) ArchiveDecompress

func (d *Teldrive) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Obj, args model.ArchiveDecompressArgs) ([]model.Obj, error)

func (*Teldrive) Config

func (d *Teldrive) Config() driver.Config

func (*Teldrive) Copy

func (d *Teldrive) Copy(ctx context.Context, srcObj, dstDir model.Obj) error

func (*Teldrive) Drop

func (d *Teldrive) Drop(ctx context.Context) error

func (*Teldrive) Extract

func (d *Teldrive) Extract(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) (*model.Link, error)

func (*Teldrive) GetAddition

func (d *Teldrive) GetAddition() driver.Additional

func (*Teldrive) GetArchiveMeta

func (d *Teldrive) GetArchiveMeta(ctx context.Context, obj model.Obj, args model.ArchiveArgs) (model.ArchiveMeta, error)

func (*Teldrive) Init

func (d *Teldrive) Init(ctx context.Context) error
func (d *Teldrive) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*Teldrive) List

func (d *Teldrive) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*Teldrive) ListArchive

func (d *Teldrive) ListArchive(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) ([]model.Obj, error)

func (*Teldrive) MakeDir

func (d *Teldrive) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error

func (*Teldrive) Move

func (d *Teldrive) Move(ctx context.Context, srcObj, dstDir model.Obj) error

func (*Teldrive) Put

func (d *Teldrive) Put(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress) error

func (*Teldrive) Remove

func (d *Teldrive) Remove(ctx context.Context, obj model.Obj) error

func (*Teldrive) Rename

func (d *Teldrive) Rename(ctx context.Context, srcObj model.Obj, newName string) error

Jump to

Keyboard shortcuts

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