attribution

package
v1.8.0-rc Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: AGPL-3.0 Imports: 4 Imported by: 0

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 CSVRow added in v0.15.0

type CSVRow struct {
	PartnerID          []byte
	ProjectID          []byte
	BucketName         []byte
	RemoteBytesPerHour float64
	InlineBytesPerHour float64
	EgressData         int64
}

CSVRow represents data from QueryAttribution without exposing dbx

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)
	// QueryAttribution queries partner bucket attribution data
	QueryAttribution(ctx context.Context, partnerID uuid.UUID, start time.Time, end time.Time) ([]*CSVRow, error)
}

DB implements the database for value attribution table

architecture: Database

type Info

type Info struct {
	ProjectID  uuid.UUID
	BucketName []byte
	PartnerID  uuid.UUID
	CreatedAt  time.Time
}

Info describing value attribution from partner to bucket

Jump to

Keyboard shortcuts

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