Documentation
¶
Overview ¶
Package billingexport holds the cost-line source, S3 sink and file encoders shared by the Cost and Usage Reports and Billing and Cost Management Data Exports emulators.
Index ¶
- Constants
- func BucketExists(ctx context.Context, store ObjectStore, bucket string) bool
- func Encode(t *Table, format, compression, baseName string) ([]byte, string, error)
- func ProductCode(service string) string
- func Put(ctx context.Context, store ObjectStore, bucket, key string, body []byte, ...) error
- func SnakeCase(s string) string
- type Column
- type CostLine
- type CostSource
- type ObjectStore
- type Table
Constants ¶
const ( TypeString = "string" TypeDouble = "double" )
Column types understood by Encode.
const ( FormatCSV = "csv" FormatParquet = "parquet" CompressNone = "none" CompressGzip = "gzip" CompressZip = "zip" )
Output file formats and compressions.
Variables ¶
This section is empty.
Functions ¶
func BucketExists ¶
func BucketExists(ctx context.Context, store ObjectStore, bucket string) bool
BucketExists reports whether bucket is present in store.
func Encode ¶
Encode renders t as format with compression and returns the body and the file extension. Parquet is always internally compressed (snappy) and ignores compression.
func ProductCode ¶
ProductCode maps a Cost Explorer service name to its billing product code.
Types ¶
type CostLine ¶
type CostLine struct {
Day time.Time
Tags map[string]string
Service string
Region string
UsageType string
Account string
AvailabilityZone string
InstanceType string
Operation string
ChargeType string
PurchaseType string
ProductFamily string
UsageTypeGroup string
ResourceID string
Blended float64
Unblended float64
Usage float64
}
CostLine is one day of cost for a service/region/usage-type/account combination.
func (CostLine) ChargeCategory ¶
ChargeCategory maps the ledger charge type onto a FOCUS ChargeCategory value.
func (CostLine) LineItemType ¶
LineItemType maps the ledger charge type onto a CUR lineItem/LineItemType value.
type CostSource ¶
CostSource yields the daily cost lines with start <= Day < end.
type ObjectStore ¶
type ObjectStore interface {
PutObject(ctx context.Context, in *sdk_s3.PutObjectInput) (*sdk_s3.PutObjectOutput, error)
HeadBucket(ctx context.Context, in *sdk_s3.HeadBucketInput) (*sdk_s3.HeadBucketOutput, error)
}
ObjectStore is the S3 surface report delivery writes to.