cloudreve_v4

package
v0.0.0-...-6e53ccd Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addition

type Addition struct {
	// Usually one of two
	driver.RootPath
	// driver.RootID
	// define other
	Address             string `json:"address" required:"true"`
	Username            string `json:"username"`
	Password            string `json:"password"`
	AccessToken         string `json:"access_token"`
	RefreshToken        string `json:"refresh_token"`
	CustomUA            string `json:"custom_ua"`
	EnableFolderSize    bool   `json:"enable_folder_size"`
	EnableThumb         bool   `json:"enable_thumb"`
	EnableVersionUpload bool   `json:"enable_version_upload"`
	OrderBy             string `json:"order_by" type:"select" options:"name,size,updated_at,created_at" default:"name" required:"true"`
	OrderDirection      string `json:"order_direction" type:"select" options:"asc,desc" default:"asc" required:"true"`
}

type BasicConfigResp

type BasicConfigResp struct {
	InstanceID string `json:"instance_id"`
	// Title        string `json:"title"`
	// Themes       string `json:"themes"`
	// DefaultTheme string `json:"default_theme"`
	User struct {
		ID string `json:"id"`
		// Nickname  string    `json:"nickname"`
		// CreatedAt time.Time `json:"created_at"`
		// Anonymous bool      `json:"anonymous"`
		Group struct {
			ID         string `json:"id"`
			Name       string `json:"name"`
			Permission string `json:"permission"`
		} `json:"group"`
	} `json:"user"`
	// Logo                string `json:"logo"`
	// LogoLight           string `json:"logo_light"`
	// CaptchaReCaptchaKey string `json:"captcha_ReCaptchaKey"`
	CaptchaType string `json:"captcha_type"` // support 'normal' only

}

type CaptchaResp

type CaptchaResp struct {
	Image  string `json:"image"`
	Ticket string `json:"ticket"`
}

type CloudreveV4

type CloudreveV4 struct {
	model.Storage
	Addition
	// contains filtered or unexported fields
}

func (*CloudreveV4) ArchiveDecompress

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

func (*CloudreveV4) Config

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

func (*CloudreveV4) Copy

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

func (*CloudreveV4) Drop

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

func (*CloudreveV4) Extract

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

func (*CloudreveV4) GetAddition

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

func (*CloudreveV4) GetArchiveMeta

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

func (*CloudreveV4) Init

func (d *CloudreveV4) Init(ctx context.Context) error

func (*CloudreveV4) InitReference

func (d *CloudreveV4) InitReference(storage driver.Driver) error
func (d *CloudreveV4) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*CloudreveV4) List

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

func (*CloudreveV4) ListArchive

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

func (*CloudreveV4) MakeDir

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

func (*CloudreveV4) Move

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

func (*CloudreveV4) Put

func (*CloudreveV4) Remove

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

func (*CloudreveV4) Rename

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

type File

type File struct {
	Type          int         `json:"type"` // 0: file, 1: folder
	ID            string      `json:"id"`
	Name          string      `json:"name"`
	CreatedAt     time.Time   `json:"created_at"`
	UpdatedAt     time.Time   `json:"updated_at"`
	Size          int64       `json:"size"`
	Metadata      interface{} `json:"metadata"`
	Path          string      `json:"path"`
	Capability    string      `json:"capability"`
	Owned         bool        `json:"owned"`
	PrimaryEntity string      `json:"primary_entity"`
}

type FileResp

type FileResp struct {
	Files         []File        `json:"files"`
	Parent        File          `json:"parent"`
	Pagination    Pagination    `json:"pagination"`
	Props         Props         `json:"props"`
	ContextHint   string        `json:"context_hint"`
	MixedType     bool          `json:"mixed_type"`
	StoragePolicy StoragePolicy `json:"storage_policy"`
}

type FileThumbResp

type FileThumbResp struct {
	URL     string    `json:"url"`
	Expires time.Time `json:"expires"`
}

type FileUploadResp

type FileUploadResp struct {
	// UploadID       string        `json:"upload_id"`
	SessionID      string        `json:"session_id"`
	ChunkSize      int64         `json:"chunk_size"`
	Expires        int64         `json:"expires"`
	StoragePolicy  StoragePolicy `json:"storage_policy"`
	URI            string        `json:"uri"`
	CompleteURL    string        `json:"completeURL,omitempty"`     // for S3-like
	CallbackSecret string        `json:"callback_secret,omitempty"` // for S3-like, OneDrive
	UploadUrls     []string      `json:"upload_urls,omitempty"`     // for not-local
	Credential     string        `json:"credential,omitempty"`      // for local
}

type FileUrlResp

type FileUrlResp struct {
	Urls []struct {
		URL string `json:"url"`
	} `json:"urls"`
	Expires time.Time `json:"expires"`
}

type FolderSummaryResp

type FolderSummaryResp struct {
	File
	FolderSummary struct {
		Size         int64     `json:"size"`
		Files        int64     `json:"files"`
		Folders      int64     `json:"folders"`
		Completed    bool      `json:"completed"`
		CalculatedAt time.Time `json:"calculated_at"`
	} `json:"folder_summary"`
}

type Object

type Object struct {
	model.Object
	StoragePolicy StoragePolicy
}

type Pagination

type Pagination struct {
	Page      int    `json:"page"`
	PageSize  int    `json:"page_size"`
	IsCursor  bool   `json:"is_cursor"`
	NextToken string `json:"next_token,omitempty"`
}

type PrepareLoginResp

type PrepareLoginResp struct {
	WebauthnEnabled bool `json:"webauthn_enabled"`
	PasswordEnabled bool `json:"password_enabled"`
}

type Props

type Props struct {
	Capability            string   `json:"capability"`
	MaxPageSize           int      `json:"max_page_size"`
	OrderByOptions        []string `json:"order_by_options"`
	OrderDirectionOptions []string `json:"order_direction_options"`
}

type Resp

type Resp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

type SiteLoginConfigResp

type SiteLoginConfigResp struct {
	LoginCaptcha bool `json:"login_captcha"`
	Authn        bool `json:"authn"`
}

type StoragePolicy

type StoragePolicy struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Type    string `json:"type"`
	MaxSize int64  `json:"max_size"`
	Relay   bool   `json:"relay,omitempty"`
}

type Token

type Token struct {
	AccessToken    string    `json:"access_token"`
	RefreshToken   string    `json:"refresh_token"`
	AccessExpires  time.Time `json:"access_expires"`
	RefreshExpires time.Time `json:"refresh_expires"`
}

type TokenResponse

type TokenResponse struct {
	User struct {
		ID string `json:"id"`
		// Email     string    `json:"email"`
		// Nickname  string    `json:"nickname"`
		Status string `json:"status"`
		// CreatedAt time.Time `json:"created_at"`
		Group struct {
			ID         string `json:"id"`
			Name       string `json:"name"`
			Permission string `json:"permission"`
		} `json:"group"`
	} `json:"user"`
	Token Token `json:"token"`
}

Jump to

Keyboard shortcuts

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