store

package
v0.0.0-...-6d3add6 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const TEMP_DIR_USE_MEMORY = "_memory"

Variables

This section is empty.

Functions

func DecodeObject

func DecodeObject(src io.Reader, block cipher.Block, iv []byte) ([]byte, error)

Decode the input data from a ReadCloser, using a given block cipher and an IV. Returns the decoded data

func DecodeObjectAndTrim

func DecodeObjectAndTrim(src io.Reader, block cipher.Block, iv []byte) ([]byte, error)

Decode the input data from a Reader, using a given block cipher and an IV. The last decoded block is checked to derive the padding value Returns the decoded data

func EncodeObject

func EncodeObject(src io.Reader, block cipher.Block, iv []byte) ([]byte, int, error)

Encode the input data from a ReadCloser, using a given block cipher and an IV. Returns the encoded data, and the number of padding bytes

func EncodePortableObject

func EncodePortableObject(src io.Reader, block cipher.Block, iv []byte) ([]byte, int, error)

Encode the input data from a ReadCloser, using a given block cipher and an IV. Returns the encoded data, and the number of padding bytes

func GetNextMultiple

func GetNextMultiple(size int64, blockSize int64) int64

func PadBuffer

func PadBuffer(buff []byte, blockSize int) ([]byte, int)

Apply padding to a buffer, given an input block size Returns the padded buffer and the number of bytes padded

func PkcsPadBuffer

func PkcsPadBuffer(buff []byte, blockSize int) ([]byte, int)

Apply padding to a buffer, given an input block size Returns the padded buffer and the number of bytes padded

func RoundToNextMultiple

func RoundToNextMultiple(size int64, blockSize int64) int64

func Uid

func Uid() string

Types

type EncryptedStore

type EncryptedStore struct {
	s3store.S3Store
	// contains filtered or unexported fields
}

func New

func New(bucket string, service s3store.S3API, key string) EncryptedStore

func (EncryptedStore) GetUpload

func (store EncryptedStore) GetUpload(ctx context.Context, id string) (handler.Upload, error)

func (EncryptedStore) NewUpload

func (store EncryptedStore) NewUpload(ctx context.Context, info handler.FileInfo) (handler.Upload, error)

func (EncryptedStore) RangeReader

func (store EncryptedStore) RangeReader(ctx context.Context, objectId string, multipartId string, start int64, length int64) (io.ReadCloser, error)

func (EncryptedStore) UseIn

func (store EncryptedStore) UseIn(composer *handler.StoreComposer)

UseIn sets this store as the core data store in the passed composer and adds all possible extension to it.

type Semaphore

type Semaphore chan struct{}

func NewSemaphore

func NewSemaphore(concurrency int) Semaphore

New creates a semaphore with the given concurrency limit.

func (Semaphore) Acquire

func (s Semaphore) Acquire()

Acquire will block until the semaphore can be acquired.

func (Semaphore) Release

func (s Semaphore) Release()

Release frees the acquired slot in the semaphore.

Jump to

Keyboard shortcuts

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