Documentation ¶
Index ¶
- Variables
- func ParseTemplate(templateContent string) *template.Template
- type Ec2Instance
- func (i *Ec2Instance) ConnectIdentifier(usePrivateID bool, useDNS bool) string
- func (i *Ec2Instance) GetTag(tagName string) string
- func (i *Ec2Instance) Name() string
- func (i *Ec2Instance) RenderLongOutput() string
- func (i *Ec2Instance) RenderShortOutput() string
- func (i *Ec2Instance) ResourceID() string
- func (i *Ec2Instance) SortKey() string
- func (i *Ec2Instance) String() string
- type Resource
- type ResourceList
Constants ¶
This section is empty.
Variables ¶
var DefaultLongOutputTemplate = `` /* 536-byte string literal not displayed */
DefaultLongOutputTemplate defines default template for the detailed output
var DefaultShortOutputTemplate = "" /* 452-byte string literal not displayed */
DefaultShortOutputTemplate defines default template for the list output
Functions ¶
func ParseTemplate ¶
ParseTemplate creates template from template string
Types ¶
type Ec2Instance ¶
type Ec2Instance struct { NativeObject ec2.Instance ShortOutputTemplate string LongOutputTemplate string }
Ec2Instance represents resource for ec2 instances
func NewEc2Instance ¶
func NewEc2Instance() *Ec2Instance
NewEc2Instance creates Ec2Instnace var with default render templates
func (*Ec2Instance) ConnectIdentifier ¶
func (i *Ec2Instance) ConnectIdentifier(usePrivateID bool, useDNS bool) string
ConnectIdentifier returns the identifier (eg. IP or DNS name) which will be used when connecting to instances
func (*Ec2Instance) GetTag ¶
func (i *Ec2Instance) GetTag(tagName string) string
GetTag returns tag value or empty string if not found
func (*Ec2Instance) RenderLongOutput ¶
func (i *Ec2Instance) RenderLongOutput() string
RenderLongOutput renders the detailed output for resource
func (*Ec2Instance) RenderShortOutput ¶
func (i *Ec2Instance) RenderShortOutput() string
RenderShortOutput renders the list output for resource
func (*Ec2Instance) ResourceID ¶
func (i *Ec2Instance) ResourceID() string
ResourceID returns unique resource ID
func (*Ec2Instance) String ¶
func (i *Ec2Instance) String() string
String returns resource attributes as string
type Resource ¶
type Resource interface { ConnectIdentifier(bool, bool) string Name() string ResourceID() string GetTag(string) string RenderShortOutput() string RenderLongOutput() string SortKey() string String() string }
Resource is an interface which all of the resources should be implementing
type ResourceList ¶
type ResourceList []Resource
ResourceList is list of resources
func (ResourceList) Less ¶
func (r ResourceList) Less(i, j int) bool
Less returns whether i is less than j