apihelper

package
v0.0.0-...-2bde035 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOrgNotFound = errors.New("organization not found")
)

Functions

This section is empty.

Types

type APIHelper

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

APIHelper implementation

func (*APIHelper) GetOrg

func (api *APIHelper) GetOrg(name string) (Organization, error)

GetOrg returns a struct that represents critical fields in the JSON

func (*APIHelper) GetOrgMemoryUsage

func (api *APIHelper) GetOrgMemoryUsage(org Organization) (float64, error)

GetOrgMemoryUsage returns the amount of memory (in MB) that the org is consuming

func (*APIHelper) GetOrgSpaces

func (api *APIHelper) GetOrgSpaces(spacesURL string) (Spaces, error)

GetOrgSpaces returns the spaces in an org.

func (*APIHelper) GetOrgs

func (api *APIHelper) GetOrgs() (Orgs, error)

GetOrgs returns a struct that represents critical fields in the JSON

func (*APIHelper) GetQuotaMemoryLimit

func (api *APIHelper) GetQuotaMemoryLimit(quotaURL string) (float64, error)

GetQuotaMemoryLimit retruns the amount of memory (in MB) that the org is allowed

func (*APIHelper) GetSpaceAppsAndServices

func (api *APIHelper) GetSpaceAppsAndServices(summaryURL string) (Apps, Services, error)

GetSpaceAppsAndServices returns the apps and the services in a space

func (*APIHelper) GetTarget

func (api *APIHelper) GetTarget() string

type App

type App struct {
	Actual float64
	Desire float64
	RAM    float64
}

App representation

type Apps

type Apps []App

type CFAPIHelper

type CFAPIHelper interface {
	GetTarget() string
	GetOrgs() (Orgs, error)
	GetOrg(string) (Organization, error)
	GetQuotaMemoryLimit(string) (float64, error)
	GetOrgMemoryUsage(Organization) (float64, error)
	GetOrgSpaces(string) (Spaces, error)
	GetSpaceAppsAndServices(string) (Apps, Services, error)
}

CFAPIHelper to wrap cf curl results

func New

type Organization

type Organization struct {
	URL       string
	Name      string
	QuotaURL  string
	SpacesURL string
}

Organization representation

type Orgs

type Orgs []Organization

type Service

type Service struct {
	Label       string
	ServicePlan string
}

Service representation

type Services

type Services []Service

type Space

type Space struct {
	Name       string
	SummaryURL string
}

Space representation

type Spaces

type Spaces []Space

Jump to

Keyboard shortcuts

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