Documentation ¶
Index ¶
- type DataStore
- type Memory
- func (m *Memory) CreateLocation(name string) (string, error)
- func (m *Memory) CreateProduct(name, category string, plans []billingapi.PricingPlan) (*billingapi.Product, error)
- func (m *Memory) CreateProductCategory(name string) (string, error)
- func (m *Memory) CreateServer(name, serverType, location string) (*bmcapi.Server, error)
- func (m *Memory) DeleteServer(serverID string) (bool, error)
- func (m *Memory) FindProduct(code, category string) (*billingapi.Product, error)
- func (m *Memory) GetLocation(name string) (string, error)
- func (m *Memory) GetProduct(code string) (*billingapi.Product, error)
- func (m *Memory) GetProductCategory(name string) (string, error)
- func (m *Memory) GetServer(serverID string) (*bmcapi.Server, error)
- func (m *Memory) ListLocations() ([]string, error)
- func (m *Memory) ListProductCategories() ([]string, error)
- func (m *Memory) ListProducts() ([]*billingapi.Product, error)
- func (m *Memory) ListServers() ([]*bmcapi.Server, error)
- func (m *Memory) UpdateProduct(name string, plans []billingapi.PricingPlan) (*billingapi.Product, error)
- func (m *Memory) UpdateServer(server *bmcapi.Server) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataStore ¶
type DataStore interface { CreateLocation(name string) (string, error) ListLocations() ([]string, error) GetLocation(name string) (string, error) CreateProductCategory(name string) (string, error) GetProductCategory(name string) (string, error) ListProductCategories() ([]string, error) ListProducts() ([]*billingapi.Product, error) GetProduct(code string) (*billingapi.Product, error) FindProduct(code, category string) (*billingapi.Product, error) CreateProduct(name, category string, plans []billingapi.PricingPlan) (*billingapi.Product, error) UpdateProduct(name string, plans []billingapi.PricingPlan) (*billingapi.Product, error) CreateServer(name, serverType, location string) (*bmcapi.Server, error) UpdateServer(server *bmcapi.Server) error ListServers() ([]*bmcapi.Server, error) GetServer(serverID string) (*bmcapi.Server, error) DeleteServer(serverID string) (bool, error) }
DataStore is the item that retrieves backend information to serve out following a contract API
type Memory ¶
Memory is an implementation of DataStore which stores everything in memory
func (*Memory) CreateLocation ¶
CreateLocation creates a new location
func (*Memory) CreateProduct ¶
func (m *Memory) CreateProduct(name, category string, plans []billingapi.PricingPlan) (*billingapi.Product, error)
CreateProduct create a single product
func (*Memory) CreateProductCategory ¶
CreateProductCategory create a single product type
func (*Memory) CreateServer ¶
CreateServer creates a new server
func (*Memory) DeleteServer ¶
DeleteServer delete a single server
func (*Memory) FindProduct ¶
func (m *Memory) FindProduct(code, category string) (*billingapi.Product, error)
GetProduct get a product by name and category
func (*Memory) GetLocation ¶
GetLocation get a single location
func (*Memory) GetProduct ¶
func (m *Memory) GetProduct(code string) (*billingapi.Product, error)
GetProduct get a product by ID
func (*Memory) GetProductCategory ¶
GetProductCategory get a single product type
func (*Memory) ListLocations ¶
ListLocations returns locations; if blank, it knows about ASH
func (*Memory) ListProductCategories ¶
func (*Memory) ListProducts ¶
func (m *Memory) ListProducts() ([]*billingapi.Product, error)
ListProducts list all products
func (*Memory) ListServers ¶
ListServers list all known servers for the project
func (*Memory) UpdateProduct ¶
func (m *Memory) UpdateProduct(name string, plans []billingapi.PricingPlan) (*billingapi.Product, error)
UpdateProduct update a single product