filesvc

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

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