Documentation
¶
Index ¶
- Constants
- Variables
- func Estimate(card *Card, table Table, req *costv1.PriceRequest) (*costv1.Estimate, error)
- func Fetch(ctx context.Context, req *http.Request) ([]byte, error)
- func Priced(card *Card, table Table, edges ...EdgeRates) (*Card, Table, error)
- func ProfileName(profile costv1.Profile) string
- func Profiles() []costv1.Profile
- func Struct(values map[string]any) (*structpb.Struct, error)
- type Allowance
- type Band
- type Card
- type Client
- type Component
- type EdgeApp
- type EdgeRates
- type EdgeScopes
- type EdgeShape
- type EdgeSite
- type Formula
- type Rate
- type Shaped
- type Step
- type Subject
- func (s *Subject) Add(c Component)
- func (s *Subject) Bool(path string) bool
- func (s *Subject) Free()
- func (s *Subject) Has(path string) bool
- func (s *Subject) List(path string) []any
- func (s *Subject) Number(path string) decimal.Decimal
- func (s *Subject) String(path string) string
- func (s *Subject) Unknown(path string) bool
- func (s *Subject) Usage(key string, band Band) decimal.Decimal
- type Table
- type Tree
- func (t *Tree) Add(scope, vendor, typ, name, region string, properties map[string]any, ...) *costv1.Resource
- func (t *Tree) AddEdge(scopes EdgeScopes, shape EdgeShape)
- func (t *Tree) AddShaped(scope, vendor, region string, shaped []Shaped)
- func (t *Tree) Scope(parent, kind, name string) string
- func (t *Tree) Set(source string) (*costv1.ResourceSet, error)
- type UsageError
Constants ¶
View Source
const ( ScopeProject = "project" ScopeEnvironment = "environment" ScopeApp = "app" )
View Source
const AllowanceAssumed = "" /* 191-byte string literal not displayed */
View Source
const DefaultProfile = costv1.Profile_PROFILE_MODERATE
Variables ¶
View Source
var DefaultClient = Client{ HTTP: tracing.NewClient(0), Attempts: 6, Base: 500 * time.Millisecond, Ceiling: 30 * time.Second, }
View Source
var MonthlyHours = decimal.NewFromInt(730)
Functions ¶
func ProfileName ¶
Types ¶
type Card ¶
type Client ¶
type EdgeScopes ¶
type EdgeScopes struct {
Environment string
}
type EdgeSite ¶
type EdgeSite struct {
Slug string
Tier environment.Tier
Region string
Apps []EdgeApp
}
type Rate ¶
type Rate struct {
ID string `json:"id"`
Region string `json:"region,omitempty"`
Unit string `json:"unit"`
Steps []Step `json:"steps"`
Allowance Allowance `json:"allowance,omitempty"`
Note string `json:"note,omitempty"`
Source string `json:"source"`
Verified string `json:"verified"`
Query map[string]string `json:"query,omitempty"`
}
type Subject ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
func (*Tree) AddEdge ¶
func (t *Tree) AddEdge(scopes EdgeScopes, shape EdgeShape)
type UsageError ¶
func (*UsageError) Error ¶
func (e *UsageError) Error() string
Click to show internal directories.
Click to hide internal directories.