core

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SignedURLOptions

type SignedURLOptions struct {
	Expiry          time.Duration
	DefaultFilename string
}

SignedURLOptions download options

type Storage

type Storage interface {
	// CreateBucket for create new folder
	CreateBucket(context.Context, string, string) error
	// BucketExists Checks if a bucket exists.
	BucketExists(ctx context.Context, bucketName string) (found bool, err error)
	// UploadFile for upload single file
	UploadFile(context.Context, string, string, []byte, io.Reader) error
	// UploadFileByReader for upload single file
	UploadFileByReader(context.Context, string, string, io.Reader, string, int64) error
	// DeleteFile for delete single file
	DeleteFile(context.Context, string, string) error
	// FilePath for store path + file name
	FilePath(string, string) string
	// GetFile for storage host + bucket + filename
	GetFileURL(string, string) string
	// DownloadFile downloads and saves the object as a file in the local filesystem.
	DownloadFile(context.Context, string, string, string) error
	// DownloadFileByProgress downloads and saves the object as a file in the local filesystem.
	DownloadFileByProgress(context.Context, string, string, string, *pb.ProgressBar) error
	// FileExist check object exist. bucket + filename
	FileExist(context.Context, string, string) bool
	// GetContent for storage bucket + filename
	GetContent(context.Context, string, string) ([]byte, error)
	// Copy Create or replace an object through server-side copying of an existing object.
	CopyFile(context.Context, string, string, string, string) error
	// Client get storage client
	Client() interface{}
	// SignedURL get signed URL
	SignedURL(context.Context, string, string, *SignedURLOptions) (string, error)
}

Storage for s3 and disk

Jump to

Keyboard shortcuts

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