lifile

package
v0.0.0-...-19e0465 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStorageAwsClient

func NewStorageAwsClient(opt *AwsClientOption) (*storageAwsClient, error)

NewStorageAwsClient .

func NewStorageLocalClient

func NewStorageLocalClient(opt *LocalClientOption) (*storageLocalClient, error)

NewStorageLocalClient .

Types

type AwsClientOption

type AwsClientOption struct {
	AccessKeyID     string
	SecretAccessKey string
	Endpoint        string
	Region          string
	DisableSSL      bool
	ForcePathStyle  bool
}

type DeleteObjectInput

type DeleteObjectInput struct {
	BucketName string
	FileName   string
}

type LocalClientOption

type LocalClientOption struct {
	Dir string
}

type ProxyInput

type ProxyInput struct {
	BucketName string
	FileName   string
}

type PutObjectInput

type PutObjectInput struct {
	File        *multipart.FileHeader
	BucketName  string
	FileSize    int64
	ContentType string
}

type PutObjectOutput

type PutObjectOutput struct {
	FileName string
	FileUrl  string
}

type Storage

type Storage interface {
	PutObject(ctx context.Context, input *PutObjectInput) (out *PutObjectOutput, err error)
	DeleteObject(ctx context.Context, input *DeleteObjectInput) (err error)
	// TODO: 文件服务实现 图片裁剪 + office 预览
	ServeFile(r *ghttp.Request, input *ProxyInput)
}

Storage 存储接口

Jump to

Keyboard shortcuts

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