interfaces

package
v1.0.1010 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	// 设置前缀
	SetPathPrefix(string)

	// 获取前缀
	GetPathPrefix() string

	// 添加前缀
	ApplyPathPrefix(string) string

	// 移除前缀
	RemovePathPrefix(string) string

	// 判断
	Has(string) bool

	// 上传
	Write(string, []byte, Config) (map[string]any, error)

	// 上传 Stream 文件类型
	WriteStream(string, io.Reader, Config) (map[string]any, error)

	// 更新
	Update(string, []byte, Config) (map[string]any, error)

	// 更新
	UpdateStream(string, io.Reader, Config) (map[string]any, error)

	// 读取
	Read(string) (map[string]any, error)

	// 读取文件为数据流
	ReadStream(string) (map[string]any, error)

	// 重命名
	Rename(string, string) error

	// 复制
	Copy(string, string) error

	// 删除
	Delete(string) error

	// 删除文件夹
	DeleteDir(string) error

	// 创建文件夹
	CreateDir(string, Config) (map[string]string, error)

	// 列出内容
	ListContents(string, ...bool) ([]map[string]any, error)

	// 文件信息
	GetMetadata(string) (map[string]any, error)

	// 文件大小
	GetSize(string) (map[string]any, error)

	// 类型
	GetMimetype(string) (map[string]any, error)

	// 获取时间戳
	GetTimestamp(string) (map[string]any, error)

	// 获取文件的权限
	GetVisibility(string) (map[string]string, error)

	// 设置文件的权限
	SetVisibility(string, string) (map[string]string, error)
}

*

  • 适配器接口 *
  • @create 2021-8-1
  • @author deatil

type Config

type Config interface {
	// 覆盖旧数据
	With(map[string]any) Config

	// 设置单个新数据
	Set(string, any) Config

	// 是否存在
	Has(string) bool

	// 获取一个带默认的值
	Get(string, ...any) any
}

*

  • 配置接口 *
  • @create 2021-8-1
  • @author deatil

Jump to

Keyboard shortcuts

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