golang-lib/web/file/manager.go

21 lines
335 B
Go
Raw Normal View History

2021-07-21 15:35:22 +02:00
package file
import (
"io"
"mime/multipart"
)
type FileManager interface {
Check(s *Service) error
Save(s *Service, fileObj *File, file multipart.File) error
Read(s *Service, fileObj *File) (io.Reader, error)
}
var (
managers = make(map[string]FileManager)
)
func AddManager(typ string, m FileManager) {
managers[typ] = m
}