storage

package
v0.0.0-...-7f5b3d9 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	// 文件id
	ID     int    `json:"id"`
	Bucket string `json:"bucket" validate:"required"`
	// 文件名
	Filename string `json:"filename" validate:"required"`
	// 类型
	ContentType string `json:"contentType" validate:"required"`
	// 大小
	Size int64 `json:"size" validate:"required"`
	// metadata
	Metadata http.Header `json:"metadata"`
	// 创建者
	Creator string `json:"creator" validate:"required"`
	// 数据
	Data []byte `json:"data" validate:"required"`
}

文件

type FileFilterParams

type FileFilterParams struct {
	// 筛选的字段
	Fields string `json:"fields"`
	// 数量
	Limit int `json:"limit"`
	// 偏移量
	Offset int `json:"offset"`
}

type FileStorage

type FileStorage interface {
	Get(ctx context.Context, bucket, filename string) (*File, error)
	Put(ctx context.Context, file File) error
	Query(ctx context.Context, params FileFilterParams) ([]*File, error)
	Count(ctx context.Context, params FileFilterParams) (int64, error)
}

func Ent

func Ent() FileStorage

func Minio

func Minio() FileStorage

Jump to

Keyboard shortcuts

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