filesvc

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 29 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	HeaderContentLength = "Content-Length" // The Content-Length entity header indicates the size of the entity-body, in bytes, sent to the recipient.
)

Variables

This section is empty.

Functions

func ApplyKmsCmk

func ApplyKmsCmk(svc *FileService)

func GetKMSKey

func GetKMSKey() string

Types

type FileService

type FileService struct {
	// contains filtered or unexported fields
}

func New

func New(options ...Option) *FileService

New 新建 Issue 实例

func (*FileService) CleanExpiredFiles

func (svc *FileService) CleanExpiredFiles(_expiredAt ...time.Time) error

func (*FileService) DeleteFile

func (svc *FileService) DeleteFile(file dao.File) error

func (*FileService) DownloadFile

func (svc *FileService) DownloadFile(w io.Writer, file dao.File) (headers map[string]string, err error)

DownloadFile write file to writer `w`, return corresponding file http response headers.

func (*FileService) GetStorage

func (svc *FileService) GetStorage(typ ...storage.Type) storage.Storager

func (*FileService) UploadFile

func (svc *FileService) UploadFile(req apistructs.FileUploadRequest) (*apistructs.File, error)

type Option

type Option func(*FileService)

Option 定义 FileService 配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

func WithDBClient

func WithDBClient(db *dao.DBClient) Option

WithDBClient 配置 FileService 数据库选项

func WithEtcdClient

func WithEtcdClient(etcdClient *etcd.Store) Option

Jump to

Keyboard shortcuts

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