Documentation
¶
Overview ¶
Package ec2 contains the EC2 search functions.
It implements the common.Results interface
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSortFields ¶
GetSortFields returns a map of the sort fields and their corresponding struct field.
The sort fields are defined in the struct tag `sort`. The function returns an error if the given field is not a valid sort field.
func SearchInstanceName ¶
SearchInstanceName returns the name of an instance.
It returns the value of the tag:Name or empty string in case that the instance has no name.
Types ¶
type Results ¶
type Results struct { // Profile is the profile used to search. Profile string `json:"profile"` // Region is the region used to search. Region string `json:"region"` // Errors contains the erros found during the search. Errors []string `json:"errors,omitempty"` // Data contains the instances found. Data []dataRow `json:"data"` // Filters is a map of strings used to search. Filters map[string][]string `json:"-"` // SortField is the field used to sort the results. SortField string `json:"-"` }
Results describes results of the EC2 instances search.
func (*Results) GetHeaders ¶
func (r *Results) GetHeaders() []interface{}
GetHeaders returns the the tag `header` of the struct fields.
func (*Results) GetProfile ¶
GetProfile returns the profile used to search.
func (*Results) GetRows ¶
func (r *Results) GetRows() []interface{}
GetRows iterates results.Data and returns the results as a slice of interface{}.
func (*Results) GetSortField ¶
GetSortField returns the field used to sort the results.