file

package
v0.0.0-...-bfc6946 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 24 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 {
	log.Log
	// contains filtered or unexported fields
}

File 文件操作

func New

func New(ctx *config.Context) *File

New New

type IService

type IService interface {
	IUploadService
	DownloadAndMakeCompose(uploadPath string, downloadURLs []string) (map[string]interface{}, error)
	DownloadImage(url string, ctx context.Context) (io.ReadCloser, error)
}

IService IService

func NewService

func NewService(ctx *config.Context) IService

type IUploadService

type IUploadService interface {
	UploadFile(filePath string, contentType string, copyFileWriter func(io.Writer) error) (map[string]interface{}, error)
	// 获取下载地址
	DownloadURL(path string, filename string) (string, error)
}

type Service

type Service struct {
	log.Log
	// contains filtered or unexported fields
}

Service Service

func (*Service) DownloadAndMakeCompose

func (s *Service) DownloadAndMakeCompose(uploadPath string, downloadURLs []string) (map[string]interface{}, error)

DownloadAndMakeCompose 下载并组合图片

func (*Service) DownloadImage

func (s *Service) DownloadImage(url string, ctx context.Context) (io.ReadCloser, error)

func (*Service) DownloadURL

func (s *Service) DownloadURL(path string, filename string) (string, error)

func (*Service) MakeCompose

func (s *Service) MakeCompose(srcImgFiles []io.ReadCloser) (image.Image, error)

MakeCompose 组合图片

func (*Service) UploadFile

func (s *Service) UploadFile(filePath string, contentType string, copyFileWriter func(io.Writer) error) (map[string]interface{}, error)

type ServiceMinio

type ServiceMinio struct {
	log.Log
	// contains filtered or unexported fields
}

ServiceMinio 文件上传

func NewServiceMinio

func NewServiceMinio(ctx *config.Context) *ServiceMinio

NewServiceMinio NewServiceMinio

func (*ServiceMinio) DownloadURL

func (sm *ServiceMinio) DownloadURL(ph string, filename string) (string, error)

func (*ServiceMinio) UploadFile

func (sm *ServiceMinio) UploadFile(filePath string, contentType string, copyFileWriter func(io.Writer) error) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳