fs

package
v0.0.0-...-33a7bac Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MaxUpload = 210000000

MaxUpload represents the maximum upload in bytes for an individual file

Variables

View Source
var (
	ErrInvalidType = errors.New("fs: invalid detected file type")
	ErrTooBig      = errors.New("fs: file too big")
	ErrNotFound    = errors.New("fs: file not found")
)

Errors that can occur during uploading

Functions

func Connect

func Connect(address, accessKey, secretKey string) error

Connect connects to a Minio instance

func DeleteFile

func DeleteFile(bucket, name string) error

DeleteFile deletes a file in a bucket.

func UploadFile

func UploadFile(bucket, name, requiredType string, rd io.Reader) (uint64, error)

UploadFile uploads a file to a bucket

Types

type File

type File struct {
	*minio.Object
	minio.ObjectInfo
}

File represents a file

func RetrieveFile

func RetrieveFile(bucket, name string) (File, error)

RetrieveFile retrieves a file in a bucket. It is recommended to use a presigned file instead.

func StatFile

func StatFile(bucket, name string) (File, error)

StatFile retrieves only the ObjectInfo component of a file in a bucket.

Jump to

Keyboard shortcuts

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