store

package
v0.0.0-...-3dce004 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteDataObject

func DeleteDataObject(ctx context.Context, key string) error

DeleteDataObject deletes the object with the given key from the configured S3 bucket.

func DeleteKvData

func DeleteKvData(ctx context.Context, key string) error

DeleteKvData deletes the KV data stored under the given key.

func InitKvClient

func InitKvClient()

func InitS3Client

func InitS3Client()

func ListDataObjects

func ListDataObjects(ctx context.Context) (map[string]types.Object, error)

func ListFileMetadata

func ListFileMetadata(ctx context.Context) (map[string]FileMetadata, error)

ListFileMetadata returns a map with file IDs and their metadata.

func ListKvKeys

func ListKvKeys(ctx context.Context) ([]string, error)

ListKvKeys returns a list of all keys in the KV store.

func ReadKvData

func ReadKvData(ctx context.Context, key string) ([]byte, error)

func UploadData

func UploadData(ctx context.Context, key string, reader io.Reader, fileSize int64) error

UploadData uploads the data from the given reader to the configured S3 bucket.

func WriteFileMetadata

func WriteFileMetadata(ctx context.Context, fileId string, metadata FileMetadata) error

func WriteKvData

func WriteKvData(ctx context.Context, key string, value []byte) error

Types

type FileMetadata

type FileMetadata struct {
	Name     crypto.EncryptedValue `json:"name"`
	Checksum crypto.EncryptedValue `json:"checksum"`
	Iv       string                `json:"iv"`
	Size     int64                 `json:"size"`
}

func ReadFileMetadata

func ReadFileMetadata(ctx context.Context, fileId string) (FileMetadata, error)

ReadFileMetadata returns the metadata stored for a file with the given file ID.

Jump to

Keyboard shortcuts

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