printer

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstanceInfo

type InstanceInfo struct {
	InstanceID       string            `header:"INSTANCE_ID"`
	PrivateIPAddress string            `header:"PRIVATE_IP"`
	PublicIPAddress  string            `header:"PUBLIC_IP"`
	InstanceType     string            `header:"TYPE"`
	StateName        string            `header:"STATE"`
	Tags             map[string]string `header:"TAGS"`
}

InstanceInfo is attributes of aws ec2 instance

func NewInstanceInfo

func NewInstanceInfo(instance *ec2.Instance) *InstanceInfo

NewInstanceInfo creates a new InstanceInfo

func (*InstanceInfo) Headers

func (info *InstanceInfo) Headers() []string

Headers gets header string array

func (*InstanceInfo) Values

func (info *InstanceInfo) Values(withColor bool) []string

Values gets value string array

type Printer

type Printer struct {
	io.Writer
	Delimiter     string
	PrintHeader   bool
	OnlyPrivateIP bool
	WithColor     bool
}

Printer is options definition of print

func NewPrinter

func NewPrinter(delim string, header, onlyPvtIP, withColor bool, w interface{}) *Printer

NewPrinter returns a new Printer

func (*Printer) PrintAll

func (pr *Printer) PrintAll(client *awsec2.Client) error

PrintAll prints information all of aws ec2 instances

Jump to

Keyboard shortcuts

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