apihelper

package
v0.0.0-...-dfd5709 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: Apache-2.0 Imports: 6 Imported by: 6

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) ([]Space, error)

GetOrgSpaces returns the spaces in an org.

func (*APIHelper) GetOrgs

func (api *APIHelper) GetOrgs() ([]Organization, 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) GetSpaceApps

func (api *APIHelper) GetSpaceApps(appsURL string) ([]App, error)

GetSpaceApps returns the apps in a space

type App

type App struct {
	Instances float64
	RAM       float64
	Running   bool
}

App representation

type CFAPIHelper

type CFAPIHelper interface {
	GetOrgs() ([]Organization, error)
	GetOrg(string) (Organization, error)
	GetQuotaMemoryLimit(string) (float64, error)
	GetOrgMemoryUsage(Organization) (float64, error)
	GetOrgSpaces(string) ([]Space, error)
	GetSpaceApps(string) ([]App, 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 Space

type Space struct {
	Name    string
	AppsURL string
}

Space representation

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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