cloudflare_imgbed

package
v4.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: AGPL-3.0 Imports: 27 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 {
	driver.RootPath
	Address          string `json:"address" required:"true" help:"Backend API address of the image hosting service, e.g., https://img.example.com"`
	Token            string `json:"token" required:"true" help:"Authentication Token"`
	SmallChannelName string `json:"smallChannelName" help:"Channel name for regular files (typically <20MB)"`
	LargeChannelName string `json:"largeChannelName" help:"Channel name for large files"`
	LargeChannelType string `` /* 191-byte string literal not displayed */
	UploadThread     int    `json:"uploadThread" type:"number" default:"3" help:"Concurrent thread count for HuggingFace chunked direct upload"`
}

type CFImgBed

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

func (*CFImgBed) Config

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

func (*CFImgBed) Drop

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

func (*CFImgBed) Get

func (d *CFImgBed) Get(ctx context.Context, pathStr string) (model.Obj, error)

func (*CFImgBed) GetAddition

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

func (*CFImgBed) Init

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

func (*CFImgBed) List

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

func (*CFImgBed) MakeDir

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

MakeDir 在图床中通常是虚拟的,此处返回虚拟目录对象以支持上传时的路径展示

func (*CFImgBed) Put

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

func (*CFImgBed) Remove

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

type FileItem

type FileItem struct {
	Name     string                 `json:"name"`
	Metadata map[string]interface{} `json:"metadata"` // 存储文件大小、哈希、时间戳等
}

type ListResponse

type ListResponse struct {
	Files       []FileItem `json:"files"`
	Directories []string   `json:"directories"`
}

ListResponse 列表接口响应

type UploadAction

type UploadAction struct {
	Href   string            `json:"href"`
	Header map[string]string `json:"header"`
}

Jump to

Keyboard shortcuts

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