Documentation
¶
Overview ¶
Package pricing periodically refreshes the instance-type catalog from Clever Cloud's public price API. It is a singleton controller: it fires once shortly after startup and then on a fixed period. A failed refresh keeps the last-known-good catalog (the binary always seeds DefaultFlavors), so the network is never on the critical path.
Index ¶
Constants ¶
View Source
const ( // DefaultRefreshPeriod is how often the catalog is refreshed on success. DefaultRefreshPeriod = 12 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(resolver Resolver, instanceTypeProvider *instancetype.Provider, period time.Duration) *Controller
NewController builds the refresher. A non-positive period falls back to DefaultRefreshPeriod.
func (*Controller) Name ¶
func (c *Controller) Name() string
func (*Controller) Reconcile ¶
func (c *Controller) Reconcile(ctx context.Context) (reconciler.Result, error)
Click to show internal directories.
Click to hide internal directories.