displayers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToHumanReadibleUnit

func BytesToHumanReadibleUnit(bytes uint64) string

BytesToHumanReadibleUnit converts byte input to a human-readable form using the largest notation possible.

func DisplayText

func DisplayText(item Displayable, out io.Writer, noHeaders bool, includeCols []string) error

DisplayText writes tabbed content to the passed in io.Writer while potentially adding or removing headers.

Types

type Account

type Account struct {
	*bl.Account
}

func (*Account) ColMap

func (a *Account) ColMap() map[string]string

func (*Account) Cols

func (a *Account) Cols() []string

func (*Account) JSON

func (a *Account) JSON(out io.Writer) error

func (*Account) KV

func (a *Account) KV() []map[string]interface{}

type Action

type Action struct {
	Actions bl.Actions
}

func (*Action) ColMap

func (a *Action) ColMap() map[string]string

func (*Action) Cols

func (a *Action) Cols() []string

func (*Action) JSON

func (a *Action) JSON(out io.Writer) error

func (*Action) KV

func (a *Action) KV() []map[string]interface{}

type Balance

type Balance struct {
	*bl.Balance
}

func (*Balance) ColMap

func (a *Balance) ColMap() map[string]string

func (*Balance) Cols

func (a *Balance) Cols() []string

func (*Balance) JSON

func (a *Balance) JSON(out io.Writer) error

func (*Balance) KV

func (a *Balance) KV() []map[string]interface{}

type BillingHistory

type BillingHistory struct {
	*bl.BillingHistory
}

func (*BillingHistory) ColMap

func (i *BillingHistory) ColMap() map[string]string

func (*BillingHistory) Cols

func (i *BillingHistory) Cols() []string

func (*BillingHistory) JSON

func (i *BillingHistory) JSON(out io.Writer) error

func (*BillingHistory) KV

func (i *BillingHistory) KV() []map[string]interface{}

type Displayable

type Displayable interface {
	Cols() []string
	ColMap() map[string]string
	KV() []map[string]interface{}
	JSON(io.Writer) error
}

Displayable is a displable entity. These are used for printing results.

type Displayer

type Displayer struct {
	OutputType string
	ColumnList string
	NoHeaders  bool

	Item Displayable
	Out  io.Writer
}

Displayer has the display options, the item to display, and where to display to

func (*Displayer) Display

func (d *Displayer) Display() error

Display ends up rendering the content in one of two formats (text|json)

type Domain

type Domain struct {
	Domains bl.Domains
}

func (*Domain) ColMap

func (d *Domain) ColMap() map[string]string

func (*Domain) Cols

func (d *Domain) Cols() []string

func (*Domain) JSON

func (d *Domain) JSON(out io.Writer) error

func (*Domain) KV

func (d *Domain) KV() []map[string]interface{}

type DomainRecord

type DomainRecord struct {
	DomainRecords bl.DomainRecords
}

func (*DomainRecord) ColMap

func (dr *DomainRecord) ColMap() map[string]string

func (*DomainRecord) Cols

func (dr *DomainRecord) Cols() []string

func (*DomainRecord) JSON

func (dr *DomainRecord) JSON(out io.Writer) error

func (*DomainRecord) KV

func (dr *DomainRecord) KV() []map[string]interface{}

type Firewall

type Firewall struct {
	Firewalls bl.Firewalls
}

func (*Firewall) ColMap

func (f *Firewall) ColMap() map[string]string

func (*Firewall) Cols

func (f *Firewall) Cols() []string

func (*Firewall) JSON

func (f *Firewall) JSON(out io.Writer) error

func (*Firewall) KV

func (f *Firewall) KV() []map[string]interface{}

type FloatingIP

type FloatingIP struct {
	FloatingIPs bl.FloatingIPs
}

func (*FloatingIP) ColMap

func (fi *FloatingIP) ColMap() map[string]string

func (*FloatingIP) Cols

func (fi *FloatingIP) Cols() []string

func (*FloatingIP) JSON

func (fi *FloatingIP) JSON(out io.Writer) error

func (*FloatingIP) KV

func (fi *FloatingIP) KV() []map[string]interface{}

type Image

type Image struct {
	Images bl.Images
}

func (*Image) ColMap

func (gi *Image) ColMap() map[string]string

func (*Image) Cols

func (gi *Image) Cols() []string

func (*Image) JSON

func (gi *Image) JSON(out io.Writer) error

func (*Image) KV

func (gi *Image) KV() []map[string]interface{}

type Invoice

type Invoice struct {
	*bl.Invoice
}

func (*Invoice) ColMap

func (i *Invoice) ColMap() map[string]string

func (*Invoice) Cols

func (i *Invoice) Cols() []string

func (*Invoice) JSON

func (i *Invoice) JSON(out io.Writer) error

func (*Invoice) KV

func (i *Invoice) KV() []map[string]interface{}

type InvoiceList

type InvoiceList struct {
	*bl.InvoiceList
}

func (*InvoiceList) ColMap

func (i *InvoiceList) ColMap() map[string]string

func (*InvoiceList) Cols

func (i *InvoiceList) Cols() []string

func (*InvoiceList) JSON

func (i *InvoiceList) JSON(out io.Writer) error

func (*InvoiceList) KV

func (i *InvoiceList) KV() []map[string]interface{}

type InvoiceSummary

type InvoiceSummary struct {
	*bl.InvoiceSummary
}

func (*InvoiceSummary) ColMap

func (i *InvoiceSummary) ColMap() map[string]string

func (*InvoiceSummary) Cols

func (i *InvoiceSummary) Cols() []string

func (*InvoiceSummary) JSON

func (i *InvoiceSummary) JSON(out io.Writer) error

func (*InvoiceSummary) KV

func (i *InvoiceSummary) KV() []map[string]interface{}

type Kernel

type Kernel struct {
	Kernels bl.Kernels
}

func (*Kernel) ColMap

func (ke *Kernel) ColMap() map[string]string

func (*Kernel) Cols

func (ke *Kernel) Cols() []string

func (*Kernel) JSON

func (ke *Kernel) JSON(out io.Writer) error

func (*Kernel) KV

func (ke *Kernel) KV() []map[string]interface{}

type Key

type Key struct {
	Keys bl.SSHKeys
}

Key is used to display the SSH Key results from a `list` operation.

func (*Key) ColMap

func (ke *Key) ColMap() map[string]string

func (*Key) Cols

func (ke *Key) Cols() []string

func (*Key) JSON

func (ke *Key) JSON(out io.Writer) error

func (*Key) KV

func (ke *Key) KV() []map[string]interface{}

type KeyGet

type KeyGet struct {
	Keys bl.SSHKeys
}

KeyGet is used to display the SSH Key results from a `get` operation. This separate displayer is required in order to include the public key in this operation.

func (*KeyGet) ColMap

func (ke *KeyGet) ColMap() map[string]string

func (*KeyGet) Cols

func (ke *KeyGet) Cols() []string

func (*KeyGet) JSON

func (ke *KeyGet) JSON(out io.Writer) error

func (*KeyGet) KV

func (ke *KeyGet) KV() []map[string]interface{}

type LoadBalancer

type LoadBalancer struct {
	LoadBalancers bl.LoadBalancers
}

func (*LoadBalancer) ColMap

func (lb *LoadBalancer) ColMap() map[string]string

func (*LoadBalancer) Cols

func (lb *LoadBalancer) Cols() []string

func (*LoadBalancer) JSON

func (lb *LoadBalancer) JSON(out io.Writer) error

func (*LoadBalancer) KV

func (lb *LoadBalancer) KV() []map[string]interface{}

type PlugDesc

type PlugDesc struct {
	Path string `json:"path"`
	Name string `json:"name"`
}

type Plugin

type Plugin struct {
	Plugins []PlugDesc
}

func (*Plugin) ColMap

func (p *Plugin) ColMap() map[string]string

func (*Plugin) Cols

func (p *Plugin) Cols() []string

func (*Plugin) JSON

func (p *Plugin) JSON(out io.Writer) error

func (*Plugin) KV

func (p *Plugin) KV() []map[string]interface{}

type Project

type Project struct {
	Projects bl.Projects
}

func (*Project) ColMap

func (p *Project) ColMap() map[string]string

func (*Project) Cols

func (p *Project) Cols() []string

func (*Project) JSON

func (p *Project) JSON(out io.Writer) error

func (*Project) KV

func (p *Project) KV() []map[string]interface{}

type ProjectResource

type ProjectResource struct {
	ProjectResources bl.ProjectResources
}

func (*ProjectResource) ColMap

func (p *ProjectResource) ColMap() map[string]string

func (*ProjectResource) Cols

func (p *ProjectResource) Cols() []string

func (*ProjectResource) JSON

func (p *ProjectResource) JSON(out io.Writer) error

func (*ProjectResource) KV

func (p *ProjectResource) KV() []map[string]interface{}

type RateLimit

type RateLimit struct {
	*bl.RateLimit
}

func (*RateLimit) ColMap

func (rl *RateLimit) ColMap() map[string]string

func (*RateLimit) Cols

func (rl *RateLimit) Cols() []string

func (*RateLimit) JSON

func (rl *RateLimit) JSON(out io.Writer) error

func (*RateLimit) KV

func (rl *RateLimit) KV() []map[string]interface{}

type Region

type Region struct {
	Regions bl.Regions
}

func (*Region) ColMap

func (re *Region) ColMap() map[string]string

func (*Region) Cols

func (re *Region) Cols() []string

func (*Region) JSON

func (re *Region) JSON(out io.Writer) error

func (*Region) KV

func (re *Region) KV() []map[string]interface{}

type Server

type Server struct {
	Servers bl.Servers
}

func (*Server) ColMap

func (d *Server) ColMap() map[string]string

func (*Server) Cols

func (d *Server) Cols() []string

func (*Server) JSON

func (d *Server) JSON(out io.Writer) error

func (*Server) KV

func (d *Server) KV() []map[string]interface{}

type Size

type Size struct {
	Sizes bl.Sizes
}

func (*Size) ColMap

func (si *Size) ColMap() map[string]string

func (*Size) Cols

func (si *Size) Cols() []string

func (*Size) JSON

func (si *Size) JSON(out io.Writer) error

func (*Size) KV

func (si *Size) KV() []map[string]interface{}

type Snapshot

type Snapshot struct {
	Snapshots bl.Snapshots
}

func (*Snapshot) ColMap

func (s *Snapshot) ColMap() map[string]string

func (*Snapshot) Cols

func (s *Snapshot) Cols() []string

func (*Snapshot) JSON

func (s *Snapshot) JSON(out io.Writer) error

func (*Snapshot) KV

func (s *Snapshot) KV() []map[string]interface{}

type Tag

type Tag struct {
	Tags bl.Tags
}

func (*Tag) ColMap

func (t *Tag) ColMap() map[string]string

func (*Tag) Cols

func (t *Tag) Cols() []string

func (*Tag) JSON

func (t *Tag) JSON(out io.Writer) error

func (*Tag) KV

func (t *Tag) KV() []map[string]interface{}

type VPC

type VPC struct {
	VPCs bl.VPCs
}

func (*VPC) ColMap

func (v *VPC) ColMap() map[string]string

func (*VPC) Cols

func (v *VPC) Cols() []string

func (*VPC) JSON

func (v *VPC) JSON(out io.Writer) error

func (*VPC) KV

func (v *VPC) KV() []map[string]interface{}

Jump to

Keyboard shortcuts

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