object_storage

package
v0.0.0-...-b2d0f57 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TEMP_DIR = "tmp"

Variables

View Source
var (
	ErrMaxFilesizeExceeded = errors.New("max file size exceeded")
	ErrInvalidFileFormat   = errors.New("invalid file format")
)

Functions

This section is empty.

Types

type Object

type Object struct {
	Name string
	Size int
}

type Service

type Service struct {
	TempDirPath string
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config) (*Service, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, bucketName string, objectName string) error

func (*Service) Get

func (s *Service) Get(ctx context.Context, bucketName string, objectName string) (string, string, error)

func (*Service) Upload

func (s *Service) Upload(ctx context.Context, bucketName string, objectName string, fileData []byte, fileSize int64, contentType string) (*Object, error)

Jump to

Keyboard shortcuts

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