foundation

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.0.0"

Version is the plugin's version

View Source
var Writer = os.Stdout

Writer - a Linux-ish specific colorized output channel.

taken from https://github.com/cloudfoundry/cli/blob/master/cf/cmd/writer_unix.go

Functions

func DefaultUI

func DefaultUI() terminal.UI

DefaultUI reads from stdin and writes to stdout

Types

type AccessToken

type AccessToken struct {
	Scopes []string `json:"scope"`
}

AccessToken has information about a user's scope

type Identifiable

type Identifiable struct {
	GUID string `mapstructure:"guid"`
}

Identifiable has a GUID field

type Labeled

type Labeled struct {
	Label string `mapstructure:"label"`
}

Labeled has a Label field

type Metadata

type Metadata struct {
	GUID      string `mapstructure:"guid"`
	URL       string `mapstructure:"url"`
	CreatedAt string `mapstructure:"created_at"`
	UpdatedAt string `mapstructure:"updated_at"`
}

Metadata represents info about a CF resource

type Named

type Named struct {
	Name string `mapstructure:"name"`
}

Named has a Name field

type OutputRow

type OutputRow struct {
	ServiceName string
	PlanName    string
	Instances   int
	Keys        int
	Bindings    int
}

OutputRow provides the structure of the info to be sent to the terminal

func (OutputRow) TableRow

func (o OutputRow) TableRow() []string

TableRow will convert the row into something consumable by the CF CLI's UI Table

type OutputRows

type OutputRows []OutputRow

OutputRows wraps []OutputRow so we can support sort.Interface

func (OutputRows) Len

func (o OutputRows) Len() int

Len returns the number of items in the slice

func (OutputRows) Less

func (o OutputRows) Less(i, j int) bool

func (OutputRows) Swap

func (o OutputRows) Swap(i, j int)

Swap swaps the items

type Page

type Page struct {
	TotalResults int        `mapstructure:"total_results"`
	TotalPages   int        `mapstructure:"total_pages"`
	PreviousURL  string     `mapstructure:"prev_url"`
	NextURL      string     `mapstructure:"next_url"`
	Resources    []Resource `mapstructure:"resources"`
}

Page is a collection of CF resources

type Resource

type Resource struct {
	Metadata Metadata               `mapstructure:"metadata"`
	Entity   map[string]interface{} `mapstructure:"entity"`
}

Resource is a CF resource

type ServiceAuditor

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

ServiceAuditor will do the thing

func NewAuditor

func NewAuditor(cli plugin.CliConnection) *ServiceAuditor

NewAuditor creates a new auditor

func (*ServiceAuditor) Audit

func (s *ServiceAuditor) Audit() (OutputRows, error)

Audit does the thing

type ServiceAuditorPlugin

type ServiceAuditorPlugin struct {
	UI terminal.UI
}

ServiceAuditorPlugin will search a given foundation for service instances, bindings, and keys

func NewAuditorPlugin

func NewAuditorPlugin(ui terminal.UI) *ServiceAuditorPlugin

NewAuditorPlugin returns an auditor with the given UI

func (*ServiceAuditorPlugin) GetMetadata

func (p *ServiceAuditorPlugin) GetMetadata() plugin.PluginMetadata

GetMetadata returns usage and version info

func (*ServiceAuditorPlugin) Run

func (p *ServiceAuditorPlugin) Run(cli plugin.CliConnection, args []string)

Run does the unit of work

func (*ServiceAuditorPlugin) Start

func (p *ServiceAuditorPlugin) Start()

Start binds the plugin

type ServiceInstance

type ServiceInstance struct {
	ServicePlanGUID string `mapstructure:"service_plan_guid"`
}

ServiceInstance has information about the service plan from which it was created

type ServicePlan

type ServicePlan struct {
	Named       `mapstructure:",squash"`
	ServiceGUID string `mapstructure:"service_guid"`
}

ServicePlan has information about the service that presents it

Jump to

Keyboard shortcuts

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