Documentation
¶
Index ¶
- func GeneratePrivateKey() (*ecdsa.PrivateKey, error)
- func PrivateKeyFromBytes(priv []byte) *ecdsa.PrivateKey
- func PrivateKeyFromHex(hexStr string) (*ecdsa.PrivateKey, error)
- func PrivateKeyToBytes(private *ecdsa.PrivateKey) []byte
- func PrivateKeyToHex(private *ecdsa.PrivateKey) string
- func PublicKeyToBytes(public *ecdsa.PublicKey) []byte
- func PublicKeyToHex(public *ecdsa.PublicKey) string
- type Addition
- type AliDrive
- func (d *AliDrive) Config() driver.Config
- func (d *AliDrive) Copy(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *AliDrive) Drop(ctx context.Context) error
- func (d *AliDrive) GetAddition() driver.Additional
- func (d *AliDrive) Init(ctx context.Context) error
- func (d *AliDrive) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *AliDrive) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *AliDrive) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error
- func (d *AliDrive) Move(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *AliDrive) Other(ctx context.Context, args model.OtherArgs) (any, error)
- func (d *AliDrive) Put(ctx context.Context, dstDir model.Obj, streamer model.FileStreamer, ...) error
- func (d *AliDrive) Remove(ctx context.Context, obj model.Obj) error
- func (d *AliDrive) Rename(ctx context.Context, srcObj model.Obj, newName string) error
- type File
- type Files
- type RespErr
- type State
- type UploadResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePrivateKey ¶ added in v4.2.0
func GeneratePrivateKey() (*ecdsa.PrivateKey, error)
GeneratePrivateKey 生成新的ECDSA私钥
func PrivateKeyFromBytes ¶ added in v4.2.0
func PrivateKeyFromBytes(priv []byte) *ecdsa.PrivateKey
PrivateKeyFromBytes 从字节数组创建私钥
func PrivateKeyFromHex ¶ added in v4.2.0
func PrivateKeyFromHex(hexStr string) (*ecdsa.PrivateKey, error)
PrivateKeyFromHex 从十六进制字符串创建私钥
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(private *ecdsa.PrivateKey) []byte
PrivateKeyToBytes 将私钥转换为字节数组
func PrivateKeyToHex ¶
func PrivateKeyToHex(private *ecdsa.PrivateKey) string
PrivateKeyToHex 将私钥转换为十六进制字符串
func PublicKeyToBytes ¶
PublicKeyToBytes 将公钥转换为字节数组
func PublicKeyToHex ¶
PublicKeyToHex 将公钥转换为十六进制字符串
Types ¶
type Addition ¶
type Addition struct {
driver.RootID
RefreshToken string `json:"refresh_token" required:"true"`
// DeviceID string `json:"device_id" required:"true"`
OrderBy string `json:"order_by" type:"select" options:"name,size,updated_at,created_at"`
OrderDirection string `json:"order_direction" type:"select" options:"ASC,DESC"`
RapidUpload bool `json:"rapid_upload"`
InternalUpload bool `json:"internal_upload"`
}
Addition 存储阿里云盘所需的额外配置信息
type AliDrive ¶
type AliDrive struct {
model.Storage
Addition
AccessToken string
DriveID string
UserID string
// contains filtered or unexported fields
}
AliDrive 阿里云盘驱动实现
func (*AliDrive) GetAddition ¶
func (d *AliDrive) GetAddition() driver.Additional
GetAddition 返回额外配置
func (*AliDrive) Link ¶
func (d *AliDrive) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
Link 获取文件下载链接
func (*AliDrive) List ¶
func (d *AliDrive) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
List 列出目录内容
func (*AliDrive) Put ¶
func (d *AliDrive) Put(ctx context.Context, dstDir model.Obj, streamer model.FileStreamer, up driver.UpdateProgress) error
Put 上传文件
type File ¶
type File struct {
DriveID string `json:"drive_id"` // 驱动ID
CreatedAt time.Time `json:"created_at"` // 创建时间
FileExtension string `json:"file_extension"` // 文件扩展名
FileID string `json:"file_id"` // 文件ID
Type string `json:"type"` // 类型
Name string `json:"name"` // 名称
Category string `json:"category"` // 分类
ParentFileID string `json:"parent_file_id"` // 父文件ID
UpdatedAt time.Time `json:"updated_at"` // 更新时间
Size int64 `json:"size"` // 大小
Thumbnail string `json:"thumbnail"` // 缩略图
URL string `json:"url"` // URL
}
File 表示阿里云盘文件信息
type Files ¶
type Files struct {
Items []File `json:"items"` // 文件列表
NextMarker string `json:"next_marker"` // 下一页标记
}
Files 表示文件列表响应
type UploadResp ¶
type UploadResp struct {
FileID string `json:"file_id"` // 文件ID
UploadID string `json:"upload_id"` // 上传ID
PartInfoList []struct {
UploadURL string `json:"upload_url"` // 上传URL
InternalUploadURL string `json:"internal_upload_url"` // 内部上传URL
} `json:"part_info_list"`
RapidUpload bool `json:"rapid_upload"` // 是否秒传
}
UploadResp 表示上传响应
Click to show internal directories.
Click to hide internal directories.