Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileStoreConfig ¶
type ListOption ¶
type ListOption interface {
ApplyToList(*ListOptions)
}
func ApplyFilters ¶
func ApplyFilters(filters fileserver.Filters) ListOption
func Paginate ¶
func Paginate(pageToken string, pageSize int) ListOption
func ShowDeleted ¶
func ShowDeleted() ListOption
type ListOptions ¶
type ListOptions struct {
Pagination *ListPagination
ShowDeleted bool
Filters fileserver.Filters
}
func (*ListOptions) ApplyOptions ¶
func (o *ListOptions) ApplyOptions(opts []ListOption) *ListOptions
type ListPagination ¶
type ListPagination struct {
Page, PageSize int
}
func (ListPagination) ApplyToList ¶
func (l ListPagination) ApplyToList(opts *ListOptions)
type StoredFileStore ¶
type StoredFileStore interface {
List(ctx context.Context, opts ...ListOption) (files []modelsv2.StoredFile, nextPageToken string, err error)
Get(ctx context.Context, id string) (*modelsv2.StoredFile, error)
GetByFileKey(ctx context.Context, fileKey *modelsv2.StoredFileKey) (*modelsv2.StoredFile, error)
Save(ctx context.Context, file *modelsv2.StoredFile) (id string, err error)
Delete(ctx context.Context, id string, permanent bool) error
Download(ctx context.Context, id string) (*modelsv2.StoredFile, error)
CleanTombstones(ctx context.Context) (int64, error)
}
func New ¶
func New(db *gorm.DB, config FileStoreConfig) (StoredFileStore, io.Closer)
Click to show internal directories.
Click to hide internal directories.