Documentation
¶
Overview ¶
Package types provides common types used by libnuke. Primarily it provides the Collection type which is used to represent a collection of strings. Additionally, it provides the Properties type which is used to add properties to a resource.
Index ¶
- type Collection
- type Properties
- func (p Properties) Equals(o Properties) bool
- func (p Properties) Get(key string) string
- func (p Properties) Set(key string, value interface{}) Properties
- func (p Properties) SetFromStruct(data interface{}) Properties
- func (p Properties) SetTag(tagKey *string, tagValue interface{}) Properties
- func (p Properties) SetTagPrefix(prefix string) Properties
- func (p Properties) SetTagWithPrefix(prefix string, tagKey *string, tagValue interface{}) Properties
- func (p Properties) SetWithPrefix(prefix, key string, value interface{}) Properties
- func (p Properties) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection []string
Collection is a collection of strings
func ResolveResourceTypes ¶
func ResolveResourceTypes( base Collection, includes, excludes, alternatives []Collection, alternativeMappings map[string]string) Collection
ResolveResourceTypes resolves the resource types based on the provided includes, excludes, and alternatives. The alternatives are a list of resource types that are to be used instead of the default resource. The primary use case for this is AWS Cloud Control API resources. If a resource has been registered with the Cloud Control API. Includes, Excludes, and Alternatives are []Collection because they are a combination of runtime, global and account level configuration.
func (Collection) Expand ¶ added in v0.23.0
func (c Collection) Expand(base []string) Collection
Expand returns a collection by using the Collection which may contain glob patterns and match to the source and returns the expanded collection, if there are no matches, it includes the original element from the collection.
func (Collection) Intersect ¶
func (c Collection) Intersect(o Collection) Collection
Intersect returns the intersection of two collections
func (Collection) Remove ¶
func (c Collection) Remove(o Collection) Collection
Remove returns the difference of two collections
func (Collection) Union ¶
func (c Collection) Union(o Collection) Collection
Union returns the union of two collections
type Properties ¶
Properties is a map of key-value pairs.
func NewPropertiesFromStruct ¶ added in v0.14.0
func NewPropertiesFromStruct(data interface{}) Properties
NewPropertiesFromStruct creates a new Properties map from a struct.
func (Properties) Equals ¶
func (p Properties) Equals(o Properties) bool
Equals compares two Properties maps.
func (Properties) Get ¶
func (p Properties) Get(key string) string
Get returns the value of a key in the Properties map.
func (Properties) Set ¶
func (p Properties) Set(key string, value interface{}) Properties
Set sets a key-value pair in the Properties map.
func (Properties) SetFromStruct ¶ added in v0.14.0
func (p Properties) SetFromStruct(data interface{}) Properties
SetFromStruct sets the Properties map from a struct by reading the structs fields
func (Properties) SetTag ¶
func (p Properties) SetTag(tagKey *string, tagValue interface{}) Properties
SetTag sets a tag key-value pair in the Properties map.
func (Properties) SetTagPrefix ¶ added in v0.15.0
func (p Properties) SetTagPrefix(prefix string) Properties
func (Properties) SetTagWithPrefix ¶
func (p Properties) SetTagWithPrefix(prefix string, tagKey *string, tagValue interface{}) Properties
SetTagWithPrefix sets a tag key-value pair in the Properties map with a prefix.
func (Properties) SetWithPrefix ¶ added in v0.11.0
func (p Properties) SetWithPrefix(prefix, key string, value interface{}) Properties
SetWithPrefix sets a key-value pair in the Properties map with a prefix.
func (Properties) String ¶
func (p Properties) String() string
String returns a string representation of the Properties map.