Documentation
¶
Index ¶
- Variables
- func CreateUploadSession(ctx context.Context, token string) error
- func DeleteDataObject(ctx context.Context, key string) error
- func DeleteFileMetadata(ctx context.Context, fileId string) error
- func DeleteKvData(ctx context.Context, namespaceId string, key string) error
- func HasFileMetadata(ctx context.Context, fileId string) bool
- func InitKvClient()
- func InitS3Client()
- func InitUploadSessionsNamespaceId()
- func ListDataObjects(ctx context.Context) (map[string]types.Object, error)
- func ListFileMetadata(ctx context.Context) (map[string]FileMetadata, error)
- func ListKvKeys(ctx context.Context, namespaceId string) ([]string, error)
- func ReadKvData(ctx context.Context, namespaceId string, key string) ([]byte, error)
- func UploadData(ctx context.Context, key string, reader io.Reader, fileSize int64) error
- func WriteFileMetadata(ctx context.Context, fileId string, metadata FileMetadata) error
- func WriteKvData(ctx context.Context, namespaceId string, key string, value []byte) error
- type DecryptedMetadata
- type FileMetadata
Constants ¶
This section is empty.
Variables ¶
var ErrNoChecksums = errors.New("no checksums found")
Functions ¶
func CreateUploadSession ¶
CreateUploadSession creates a new pending upload session for the given token in the sessions KV namespace.
func DeleteDataObject ¶
DeleteDataObject deletes the object with the given key from the configured S3 bucket.
func DeleteKvData ¶
DeleteKvData deletes the KV data stored under the given key.
func HasFileMetadata ¶
HasFileMetadata checks if a file with the given file ID exists in the KV store.
func InitKvClient ¶
func InitKvClient()
func InitS3Client ¶
func InitS3Client()
func InitUploadSessionsNamespaceId ¶
func InitUploadSessionsNamespaceId()
func ListFileMetadata ¶
func ListFileMetadata(ctx context.Context) (map[string]FileMetadata, error)
ListFileMetadata returns a map with file IDs and their metadata.
func ListKvKeys ¶
ListKvKeys returns a list of all keys in the KV store.
func ReadKvData ¶
ReadKvData reads the value stored under the given key from the KV store.
func UploadData ¶
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
Types ¶
type DecryptedMetadata ¶
type FileMetadata ¶
type FileMetadata struct {
Name crypto.EncryptedValue `json:"name"`
Checksum *crypto.EncryptedValue `json:"checksum,omitempty"`
Checksums map[string]crypto.EncryptedValue `json:"checksums,omitempty"`
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.
func (*FileMetadata) Decrypt ¶
func (metadata *FileMetadata) Decrypt(keyString string) (*DecryptedMetadata, error)