storage

package
v0.0.0-...-cb929b8 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BifStorage

type BifStorage interface {
	// UploadFileFromTempFile uploads the contents of the given file to S3 compatible storage
	UploadObjectFromTempFile(objectKey, pathToTempBif string) error
	// UploadObject uploads the contents of the given reader to S3 compatible storage
	UploadObject(objectKey string, reader io.ReadSeeker) error
	// GetSectionFromObject pulls a section of data from the given object instead of the full object
	GetSectionFromObject(objectKey string, offsetFromFileStart, size uint32) ([]byte, error)
	// PresignGetObject created a presigned URL to use to get the requested object without needing to share the creds
	PresignGetObject(objectKey string) (string, error)
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func New

func New(conf *config.Config, log zerolog.Logger) (*Storage, error)

func (*Storage) GetSectionFromObject

func (s *Storage) GetSectionFromObject(objectKey string, offsetFromFileStart, size uint32) ([]byte, error)

GetSectionFromObject pulls a section of data from the given object instead of the full object

func (*Storage) PresignGetObject

func (s *Storage) PresignGetObject(objectKey string) (string, error)

func (*Storage) UploadObject

func (s *Storage) UploadObject(objectKey string, reader io.ReadSeeker) error

UploadObject uploads the contents of the given reader to S3 compatible storage

func (*Storage) UploadObjectFromTempFile

func (s *Storage) UploadObjectFromTempFile(objectKey, pathToTempBif string) error

UploadObjectFromTempFile uploads the contents of the given file to S3 compatible storage

Jump to

Keyboard shortcuts

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