Documentation
¶
Index ¶
- type PostgresStore
- func (s *PostgresStore) ApplyBatch(ctx context.Context, ops []metadata.Op) error
- func (s *PostgresStore) CleanupExpiredLinks(ctx context.Context, before time.Time) (int, error)
- func (s *PostgresStore) CleanupUsedLinks(ctx context.Context, olderThan time.Time) (int, error)
- func (s *PostgresStore) Close() error
- func (s *PostgresStore) ConsumeSingleUseLink(ctx context.Context, token string, usedByIP string, now time.Time) (*metadata.SingleUseLink, bool, error)
- func (s *PostgresStore) CountActiveSingleUseLinks(ctx context.Context, owner string, now time.Time) (int, error)
- func (s *PostgresStore) CountEmptyETags(ctx context.Context) (int, error)
- func (s *PostgresStore) CountEmptyOwners(ctx context.Context) (int, error)
- func (s *PostgresStore) Create(ctx context.Context, md *metadata.Metadata) error
- func (s *PostgresStore) CreateErasureInfo(ctx context.Context, filePath string, info *metadata.ErasureFileInfo) error
- func (s *PostgresStore) CreateSingleUseLink(ctx context.Context, link *metadata.SingleUseLink) error
- func (s *PostgresStore) Delete(ctx context.Context, path string) error
- func (s *PostgresStore) DeleteErasureInfo(ctx context.Context, filePath string) error
- func (s *PostgresStore) Get(ctx context.Context, path string) (*metadata.Metadata, error)
- func (s *PostgresStore) GetErasureInfo(ctx context.Context, filePath string) (*metadata.ErasureFileInfo, error)
- func (s *PostgresStore) GetSingleUseLink(ctx context.Context, token string) (*metadata.SingleUseLink, error)
- func (s *PostgresStore) GetSingleUseLinkByID(ctx context.Context, id int64) (*metadata.SingleUseLink, error)
- func (s *PostgresStore) HasChildren(ctx context.Context, parentPath string) (bool, error)
- func (s *PostgresStore) ListByPrefix(ctx context.Context, prefix, startAfter string, limit int) ([]*metadata.Metadata, error)
- func (s *PostgresStore) ListChildren(ctx context.Context, parentPath string) ([]*metadata.Metadata, error)
- func (s *PostgresStore) ListChildrenPage(ctx context.Context, parentPath, afterType, afterName string, limit int) ([]*metadata.Metadata, error)
- func (s *PostgresStore) ListDescendants(ctx context.Context, dirPath string, maxDepth, limit int) ([]*metadata.Metadata, error)
- func (s *PostgresStore) ListErasureInfos(ctx context.Context, prefix, cursor string, limit int) ([]*metadata.ErasureFileInfo, string, error)
- func (s *PostgresStore) ListSingleUseLinks(ctx context.Context, filter metadata.LinkFilter) ([]metadata.SingleUseLink, string, error)
- func (s *PostgresStore) OwnerStats(ctx context.Context, cursor string, limit int) ([]metadata.OwnerStat, string, error)
- func (s *PostgresStore) Rename(ctx context.Context, oldPath, newPath string) error
- func (s *PostgresStore) RevokeSingleUseLink(ctx context.Context, id int64) error
- func (s *PostgresStore) SearchMetadata(ctx context.Context, q metadata.SearchQuery) (metadata.SearchResult, error)
- func (s *PostgresStore) Update(ctx context.Context, md *metadata.Metadata) error
- func (s *PostgresStore) UpdateIfMatch(ctx context.Context, md *metadata.Metadata, expectedETag string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
PostgresStore implements the metadata.Store interface using PostgreSQL
func (*PostgresStore) ApplyBatch ¶
func (*PostgresStore) CleanupExpiredLinks ¶
func (*PostgresStore) CleanupUsedLinks ¶
func (*PostgresStore) Close ¶
func (s *PostgresStore) Close() error
Close closes the database connection
func (*PostgresStore) ConsumeSingleUseLink ¶
func (*PostgresStore) CountActiveSingleUseLinks ¶
func (*PostgresStore) CountEmptyETags ¶
func (s *PostgresStore) CountEmptyETags(ctx context.Context) (int, error)
func (*PostgresStore) CountEmptyOwners ¶
func (s *PostgresStore) CountEmptyOwners(ctx context.Context) (int, error)
func (*PostgresStore) CreateErasureInfo ¶
func (s *PostgresStore) CreateErasureInfo(ctx context.Context, filePath string, info *metadata.ErasureFileInfo) error
func (*PostgresStore) CreateSingleUseLink ¶
func (s *PostgresStore) CreateSingleUseLink(ctx context.Context, link *metadata.SingleUseLink) error
CreateSingleUseLink creates a new single-use download link
func (*PostgresStore) Delete ¶
func (s *PostgresStore) Delete(ctx context.Context, path string) error
Delete removes an inode by path
func (*PostgresStore) DeleteErasureInfo ¶
func (s *PostgresStore) DeleteErasureInfo(ctx context.Context, filePath string) error
func (*PostgresStore) GetErasureInfo ¶
func (s *PostgresStore) GetErasureInfo(ctx context.Context, filePath string) (*metadata.ErasureFileInfo, error)
func (*PostgresStore) GetSingleUseLink ¶
func (s *PostgresStore) GetSingleUseLink(ctx context.Context, token string) (*metadata.SingleUseLink, error)
GetSingleUseLink retrieves a single-use link by token
func (*PostgresStore) GetSingleUseLinkByID ¶
func (s *PostgresStore) GetSingleUseLinkByID(ctx context.Context, id int64) (*metadata.SingleUseLink, error)
func (*PostgresStore) HasChildren ¶
func (*PostgresStore) ListByPrefix ¶
func (*PostgresStore) ListChildren ¶
func (s *PostgresStore) ListChildren(ctx context.Context, parentPath string) ([]*metadata.Metadata, error)
ListChildren lists all direct children of a directory
func (*PostgresStore) ListChildrenPage ¶
func (*PostgresStore) ListDescendants ¶
func (*PostgresStore) ListErasureInfos ¶
func (s *PostgresStore) ListErasureInfos(ctx context.Context, prefix, cursor string, limit int) ([]*metadata.ErasureFileInfo, string, error)
func (*PostgresStore) ListSingleUseLinks ¶
func (s *PostgresStore) ListSingleUseLinks(ctx context.Context, filter metadata.LinkFilter) ([]metadata.SingleUseLink, string, error)
func (*PostgresStore) OwnerStats ¶
func (*PostgresStore) Rename ¶
func (s *PostgresStore) Rename(ctx context.Context, oldPath, newPath string) error
Rename re-keys an inode (and, for a directory, its whole subtree) from oldPath to newPath in a single transaction. Only name and path change.
func (*PostgresStore) RevokeSingleUseLink ¶
func (s *PostgresStore) RevokeSingleUseLink(ctx context.Context, id int64) error
func (*PostgresStore) SearchMetadata ¶
func (s *PostgresStore) SearchMetadata(ctx context.Context, q metadata.SearchQuery) (metadata.SearchResult, error)