Documentation
¶
Index ¶
Constants ¶
View Source
const AccessTokenHeaderName = "X-Access-Token"
AccessTokenHeaderName _
View Source
const ErrFileNotFoundCode = "FILE_NOT_FOUND"
ErrFileNotFoundCode _
Variables ¶
View Source
var ErrFileNotFound = errors.New(ErrFileNotFoundCode)
ErrFileNotFound _
View Source
var ErrMissingAccessToken = errors.New("MISSING_ACCESS_TOKEN")
ErrMissingAccessToken _
View Source
var ErrNotAuthorized = errors.New("NOT_AUTHORIZED")
ErrNotAuthorized _
View Source
var ErrUnknown = errors.New("UNKNOWN_ERROR")
ErrUnknown _
Functions ¶
Types ¶
type Config ¶
type Config struct { S3Host string S3AccessKey string S3AccessSecret string S3Bucket string S3Path string Host string AllowedAccessToken string }
Config _
type ErrorResponse ¶
type ErrorResponse struct { Code string `json:"code"` Message string `json:"message"` Description string `json:"description"` }
ErrorResponse _
type MinioInteractor ¶
type MinioInteractor interface { PutObject(bucketName string, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (n int64, err error) StatObject(bucketName string, objectName string, opts minio.StatObjectOptions) (minio.ObjectInfo, error) GetObject(bucketName, objectName string, opts minio.GetObjectOptions) (*minio.Object, error) }
MinioInteractor _
type MultipartFile ¶
type MultipartFile struct {
// contains filtered or unexported fields
}
MultipartFile _
func NewMultipartFile ¶
func NewMultipartFile(file *multipart.FileHeader) (*MultipartFile, error)
NewMultipartFile _
type Storage ¶
type Storage struct { S3Bucket string S3Path string URLBuilder FileURLBuilder // contains filtered or unexported fields }
Storage _
func (*Storage) GetFileByChecksum ¶
func (u *Storage) GetFileByChecksum(checksum string) (*StorageFile, error)
GetFileByChecksum _
func (*Storage) UploadFile ¶
UploadFile _
func (*Storage) UploadFileIfNotExists ¶
UploadFileIfNotExists _
type StorageConfig ¶
type StorageConfig struct { S3Host string S3AccessKey string S3AccessSecret string S3Bucket string S3Path string URLBuilder FileURLBuilder }
StorageConfig _
Click to show internal directories.
Click to hide internal directories.