Documentation
¶
Index ¶
- func CountSavedFilesByIdentityID(ctx context.Context, exec boil.ContextExecutor, identityID string) (int, error)
- func Create(ctx context.Context, exec boil.ContextExecutor, encryptedFile EncryptedFile) error
- func CreateSavedFile(ctx context.Context, exec boil.ContextExecutor, savedFile *SavedFile) error
- func Delete(ctx context.Context, exec boil.ContextExecutor, repo FileStorageRepo, ...) error
- func DeleteSavedFile(ctx context.Context, exec boil.ContextExecutor, id string) error
- func Download(ctx context.Context, repo FileStorageRepo, fileID string) (io.Reader, error)
- func Upload(ctx context.Context, repo FileStorageRepo, fileID string, encData io.Reader) error
- type EncryptedFile
- type FileAmazonS3
- type FileStorageRepo
- type FileSystem
- type SavedFile
- type SavedFileFilters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountSavedFilesByIdentityID ¶
func CountSavedFilesByIdentityID(ctx context.Context, exec boil.ContextExecutor, identityID string) (int, error)
CountSavedFilesByIdentityID ...
func Create ¶
func Create(ctx context.Context, exec boil.ContextExecutor, encryptedFile EncryptedFile) error
Create ...
func CreateSavedFile ¶
CreateSavedFile ...
func Delete ¶
func Delete(ctx context.Context, exec boil.ContextExecutor, repo FileStorageRepo, fileID string) error
Delete ...
func DeleteSavedFile ¶
DeleteSavedFile ...
func Download ¶
Download ...
Types ¶
type EncryptedFile ¶
EncryptedFile ...
func Get ¶
func Get(ctx context.Context, exec boil.ContextExecutor, fileID string) (*EncryptedFile, error)
Get ...
type FileAmazonS3 ¶
type FileAmazonS3 struct {
// contains filtered or unexported fields
}
FileAmazonS3 ...
func NewFileAmazonS3 ¶
func NewFileAmazonS3(region, bucket string) *FileAmazonS3
NewFileAmazonS3 init an S3 session
func (*FileAmazonS3) Delete ¶
func (s *FileAmazonS3) Delete(ctx context.Context, fileID string) error
Delete data from s3 at {bucket}/{fileID}
func (*FileAmazonS3) Download ¶
Download data from amazon S3 at {bucket}/{fileID}
type FileStorageRepo ¶
type FileStorageRepo interface { Upload(context.Context, string, io.Reader) error Download(context.Context, string) (io.Reader, error) Delete(context.Context, string) error }
FileStorageRepo ...
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
FileSystem contains the files storage location
func NewFileSystem ¶
func NewFileSystem(location string) *FileSystem
NewFileSystem constructor /!\ NOT SAFE TO USE IN PRODUCTION
func (*FileSystem) Delete ¶
func (fs *FileSystem) Delete(ctx context.Context, fileID string) error
Delete a file from the file system
func (*FileSystem) Download ¶
Download a file from local storage and return its raw data
type SavedFile ¶
type SavedFile struct { ID string `json:"id"` IdentityID string `json:"identity_id"` EncryptedFileID string `json:"encrypted_file_id"` EncryptedMetadata string `json:"encrypted_metadata"` KeyFingerprint string `json:"key_fingerprint"` CreatedAt time.Time `json:"created_at"` }
SavedFile ...
func GetSavedFile ¶
GetSavedFile ...
func ListSavedFiles ¶
func ListSavedFiles(ctx context.Context, exec boil.ContextExecutor, filters SavedFileFilters) ([]SavedFile, error)
ListSavedFiles ...
Click to show internal directories.
Click to hide internal directories.