billing

package
v0.0.0-...-d791614 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParse

func MustParse(layout, value string) time.Time

func New

func New(projectID, tableName string) (*bqRepository, error)

Types

type Cost

type Cost struct {
	ProjectName string  `bigquery:"project_name"`
	Day         string  `bigquery:"export_time"`
	Cost        float64 `bigquery:"cost"`
	Currency    string  `bigquery:"currency"`
}

Cost is gcp billing per project and day. c.f. https://cloud.google.com/billing/docs/how-to/export-data-bigquery#billing_data_in

type ProjectCost

type ProjectCost []Cost

ProjectCost is timeseries cost per project

func (ProjectCost) Timeseries

func (p ProjectCost) Timeseries() ([]time.Time, []float64)

Timeseries is convert ProjectCost to X,Y axis.

type TotalCost

type TotalCost []Cost

ProjectCost is timeseries cost per project

func (TotalCost) Currency

func (t TotalCost) Currency() string

func (TotalCost) DividePerProject

func (t TotalCost) DividePerProject() map[string]ProjectCost

Divide total cost to per project.

Jump to

Keyboard shortcuts

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