Documentation ¶
Overview ¶
Package attribution implements value attribution from docs/design/value-attribution.md
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBucketNotAttributed = errs.Class("bucket not attributed")
ErrBucketNotAttributed is returned if a requested bucket not attributed(entry not found).
Functions ¶
This section is empty.
Types ¶
type BucketUsage ¶ added in v1.54.1
type BucketUsage struct { UserAgent []byte ProjectID []byte BucketName []byte ByteHours float64 SegmentHours float64 ObjectHours float64 EgressData int64 Hours int }
BucketUsage is the usage data for a single bucket.
type DB ¶
type DB interface { // Get retrieves attribution info using project id and bucket name. Get(ctx context.Context, projectID uuid.UUID, bucketName []byte) (*Info, error) // Insert creates and stores new Info. Insert(ctx context.Context, info *Info) (*Info, error) // UpdateUserAgent updates bucket attribution data. UpdateUserAgent(ctx context.Context, projectID uuid.UUID, bucketName string, userAgent []byte) error // QueryAttribution queries partner bucket attribution data. QueryAttribution(ctx context.Context, userAgent []byte, start time.Time, end time.Time) ([]*BucketUsage, error) // QueryAllAttribution queries all partner bucket usage data. QueryAllAttribution(ctx context.Context, start time.Time, end time.Time) ([]*BucketUsage, error) }
DB implements the database for value attribution table.
architecture: Database
Click to show internal directories.
Click to hide internal directories.