catalog

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog represents a local in memory cache of catalog data

func New

func New(ctx context.Context, client *catalogClient.Catalog) (*Catalog, error)

New creates a new instance of a Catalog struct and populates it with data from the API using the provided Catalog API client and context

func (*Catalog) FetchPlanById added in v0.9.2

func (c *Catalog) FetchPlanById(ctx context.Context, planID manifold.ID) (*catalogModels.Plan, error)

func (*Catalog) FetchPlanByLabel added in v0.9.2

func (c *Catalog) FetchPlanByLabel(ctx context.Context,
	productID manifold.ID, planLabel string) (*catalogModels.Plan, error)

func (*Catalog) GetPlan

func (c *Catalog) GetPlan(ID manifold.ID) (*catalogModels.Plan, error)

GetPlan returns the Plan data model based on the provided id

func (*Catalog) GetProduct

func (c *Catalog) GetProduct(ID manifold.ID) (*catalogModels.Product, error)

GetProduct returns the Product data model based on the provided id

func (*Catalog) GetRegion

func (c *Catalog) GetRegion(ID manifold.ID) (*catalogModels.Region, error)

GetRegion returns the Region data model based on the provided string id

func (*Catalog) Plans

func (c *Catalog) Plans() []*catalogModels.Plan

Returns a list of Plans from the Catalog

func (*Catalog) Products

func (c *Catalog) Products() []*catalogModels.Product

Returns a list of Products from the Catalog

func (*Catalog) Regions

func (c *Catalog) Regions() []*catalogModels.Region

Returns a list of Regions from the Catalog

func (*Catalog) Sync

func (c *Catalog) Sync(ctx context.Context) error

Sync attempts to update the catalog and returns an error if anything went wrong

Jump to

Keyboard shortcuts

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