postgres

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresDB

type PostgresDB struct {
	// contains filtered or unexported fields
}

func NewPostgresDB

func NewPostgresDB(dsn string) (*PostgresDB, error)

func (*PostgresDB) BulkDeleteObjects

func (db *PostgresDB) BulkDeleteObjects(ctx context.Context, ids []string) error

func (*PostgresDB) BulkUpdateAccessMethods

func (db *PostgresDB) BulkUpdateAccessMethods(ctx context.Context, updates map[string][]objects.AccessMethod) error

func (*PostgresDB) CreateBucketScope

func (db *PostgresDB) CreateBucketScope(ctx context.Context, scope *buckets.Scope) error

func (*PostgresDB) CreateObject

func (db *PostgresDB) CreateObject(ctx context.Context, obj *objects.Record) error

func (*PostgresDB) CreateObjectAlias

func (db *PostgresDB) CreateObjectAlias(ctx context.Context, aliasID, canonicalObjectID string) error

func (*PostgresDB) DeleteBucketScope

func (db *PostgresDB) DeleteBucketScope(ctx context.Context, organization, projectID, credentialID, pathPrefix string) error

func (*PostgresDB) DeleteObject

func (db *PostgresDB) DeleteObject(ctx context.Context, id string) error

func (*PostgresDB) DeleteObjectAlias

func (db *PostgresDB) DeleteObjectAlias(ctx context.Context, aliasID string) error

func (*PostgresDB) DeleteS3Credential

func (db *PostgresDB) DeleteS3Credential(ctx context.Context, credentialID string) error

func (*PostgresDB) GetBucketScope

func (db *PostgresDB) GetBucketScope(ctx context.Context, organization, projectID string) (*buckets.Scope, error)

func (*PostgresDB) GetBulkObjects

func (db *PostgresDB) GetBulkObjects(ctx context.Context, ids []string) ([]objects.Record, error)

func (*PostgresDB) GetFileUsage

func (db *PostgresDB) GetFileUsage(ctx context.Context, objectID string) (*usage.FileUsage, error)

func (*PostgresDB) GetFileUsageSummary

func (db *PostgresDB) GetFileUsageSummary(ctx context.Context, inactiveSince *time.Time) (usage.FileUsageSummary, error)

func (*PostgresDB) GetFileUsageSummaryByResources

func (db *PostgresDB) GetFileUsageSummaryByResources(ctx context.Context, resources []string, includeUnscoped bool, inactiveSince *time.Time) (usage.FileUsageSummary, error)

func (*PostgresDB) GetFileUsageSummaryByScope

func (db *PostgresDB) GetFileUsageSummaryByScope(ctx context.Context, organization, project string, inactiveSince *time.Time) (usage.FileUsageSummary, error)

func (*PostgresDB) GetObject

func (db *PostgresDB) GetObject(ctx context.Context, id string) (*objects.Record, error)

func (*PostgresDB) GetObjectsByChecksum

func (db *PostgresDB) GetObjectsByChecksum(ctx context.Context, checksum string) ([]objects.Record, error)

func (*PostgresDB) GetObjectsByChecksums

func (db *PostgresDB) GetObjectsByChecksums(ctx context.Context, checksums []string) (map[string][]objects.Record, error)

func (*PostgresDB) GetPendingMetadata

func (db *PostgresDB) GetPendingMetadata(ctx context.Context, oid string) (*transferlfs.PendingMetadata, error)

func (*PostgresDB) GetProjectRecordSummaryByScope

func (db *PostgresDB) GetProjectRecordSummaryByScope(ctx context.Context, organization, project string) (usage.FileUsageSummary, error)

func (*PostgresDB) GetS3Credential

func (db *PostgresDB) GetS3Credential(ctx context.Context, credentialID string) (*buckets.Credential, error)

func (*PostgresDB) GetTransferAttributionBreakdown

func (db *PostgresDB) GetTransferAttributionBreakdown(ctx context.Context, filter usage.Filter, groupBy string) ([]usage.Breakdown, error)

func (*PostgresDB) GetTransferAttributionBreakdownByResources

func (db *PostgresDB) GetTransferAttributionBreakdownByResources(ctx context.Context, filter usage.Filter, groupBy string, resources []string) ([]usage.Breakdown, error)

func (*PostgresDB) GetTransferAttributionSummary

func (db *PostgresDB) GetTransferAttributionSummary(ctx context.Context, filter usage.Filter) (usage.Summary, error)

func (*PostgresDB) GetTransferAttributionSummaryByResources

func (db *PostgresDB) GetTransferAttributionSummaryByResources(ctx context.Context, filter usage.Filter, resources []string) (usage.Summary, error)

func (*PostgresDB) ListBucketScopes

func (db *PostgresDB) ListBucketScopes(ctx context.Context) ([]buckets.Scope, error)

func (*PostgresDB) ListBucketVisibilityRows

func (db *PostgresDB) ListBucketVisibilityRows(ctx context.Context, resources []string, includeUnscoped, restrictToResources bool) ([]buckets.VisibilityRow, error)

func (*PostgresDB) ListFileUsage

func (db *PostgresDB) ListFileUsage(ctx context.Context, limit, offset int, inactiveSince *time.Time) ([]usage.FileUsage, error)

func (*PostgresDB) ListFileUsageByObjectIDs

func (db *PostgresDB) ListFileUsageByObjectIDs(ctx context.Context, ids []string) ([]usage.FileUsage, error)

func (*PostgresDB) ListFileUsagePageByResources

func (db *PostgresDB) ListFileUsagePageByResources(ctx context.Context, resources []string, includeUnscoped bool, limit, offset int, inactiveSince *time.Time) ([]usage.FileUsage, error)

func (*PostgresDB) ListFileUsagePageByScope

func (db *PostgresDB) ListFileUsagePageByScope(ctx context.Context, organization, project string, limit, offset int, inactiveSince *time.Time) ([]usage.FileUsage, error)

func (*PostgresDB) ListObjectIDsByChecksumsAndResources

func (db *PostgresDB) ListObjectIDsByChecksumsAndResources(ctx context.Context, checksums []string, resources []string, includeUnscoped, restrictToResources bool) (map[string][]string, error)

func (*PostgresDB) ListObjectIDsByResources

func (db *PostgresDB) ListObjectIDsByResources(ctx context.Context, resources []string, includeUnscoped bool) ([]string, error)

func (*PostgresDB) ListObjectIDsByScope

func (db *PostgresDB) ListObjectIDsByScope(ctx context.Context, organization, project string) ([]string, error)

func (*PostgresDB) ListObjectIDsByScopeAndResources

func (db *PostgresDB) ListObjectIDsByScopeAndResources(ctx context.Context, organization, project string, resources []string, restrictToResources bool) ([]string, error)

func (*PostgresDB) ListObjectIDsPageByResources

func (db *PostgresDB) ListObjectIDsPageByResources(ctx context.Context, resources []string, includeUnscoped bool, startAfter string, limit, offset int) ([]string, error)

func (*PostgresDB) ListObjectIDsPageByScope

func (db *PostgresDB) ListObjectIDsPageByScope(ctx context.Context, organization, project, startAfter string, limit, offset int) ([]string, error)

func (*PostgresDB) ListObjectIDsPageByURL

func (db *PostgresDB) ListObjectIDsPageByURL(ctx context.Context, objectURL, organization, project, startAfter string, limit, offset int, resources []string, includeUnscoped, restrictToResources bool) ([]string, error)

func (*PostgresDB) ListS3Credentials

func (db *PostgresDB) ListS3Credentials(ctx context.Context) ([]buckets.Credential, error)

func (*PostgresDB) ListScopedObjectIDsByChecksums

func (db *PostgresDB) ListScopedObjectIDsByChecksums(ctx context.Context, organization, project string, checksums []string) (map[string][]string, error)

func (*PostgresDB) PopPendingMetadata

func (db *PostgresDB) PopPendingMetadata(ctx context.Context, oid string) (*transferlfs.PendingMetadata, error)

func (*PostgresDB) RecordFileDownload

func (db *PostgresDB) RecordFileDownload(ctx context.Context, objectID string) error

func (*PostgresDB) RecordFileUpload

func (db *PostgresDB) RecordFileUpload(ctx context.Context, objectID string) error

func (*PostgresDB) RecordProviderTransferEvents

func (db *PostgresDB) RecordProviderTransferEvents(ctx context.Context, events []usage.ProviderEvent) error

func (*PostgresDB) RecordTransferAttributionEvents

func (db *PostgresDB) RecordTransferAttributionEvents(ctx context.Context, events []usage.Event) error

func (*PostgresDB) RegisterObjects

func (db *PostgresDB) RegisterObjects(ctx context.Context, objects []objects.Record) error

RegisterObjects is the content identity write boundary. A transaction advisory lock serializes both SHA lookup and UUID claims across processes.

func (*PostgresDB) RemoveObjectControlledAccess

func (db *PostgresDB) RemoveObjectControlledAccess(ctx context.Context, objectID, resource string) error

func (*PostgresDB) RemoveObjectControlledAccessBulk

func (db *PostgresDB) RemoveObjectControlledAccessBulk(ctx context.Context, objectIDs []string, resource string) (int, error)

func (*PostgresDB) ReplaceObjects

func (db *PostgresDB) ReplaceObjects(ctx context.Context, objects []objects.Record) error

ReplaceObjects is the checked, atomic boundary for whole-object updates. Registration remains additive; replacement is reserved for callers that have update authority over every current grant.

func (*PostgresDB) ResolveObjectAlias

func (db *PostgresDB) ResolveObjectAlias(ctx context.Context, aliasID string) (string, error)

func (*PostgresDB) SavePendingMetadata

func (db *PostgresDB) SavePendingMetadata(ctx context.Context, entries []transferlfs.PendingMetadata) error

func (*PostgresDB) SaveS3Credential

func (db *PostgresDB) SaveS3Credential(ctx context.Context, cred *buckets.Credential) error

func (*PostgresDB) UpdateObjectAccessMethods

func (db *PostgresDB) UpdateObjectAccessMethods(ctx context.Context, objectID string, accessMethods []objects.AccessMethod) error

Jump to

Keyboard shortcuts

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