Documentation ¶
Overview ¶
Package arn provides utilities for manipulating Amazon Resource Names: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
Index ¶
Constants ¶
const ( DELIMITER = ":" MAXLENGHT = 6 )
Variables ¶
This section is empty.
Functions ¶
func AWSRegions ¶
AWSRegions returns a slice of valid AWS region names. If the nil is passed for the client then a static list of well known regions is returned rather than making an HTTP request.
func Valid ¶
Valid checks the format and content of the ARN string are valid. The http.Client is required to check the region in the ARN is valid against an authoritative AWS data source. To disable the HTTP check for the region pass nil as the client and the region will be checked against a static set of well known AWS regions only.
func ValidRegion ¶
ValidRegion checks the region is a valid AWS region. The http.Client is required to check the region against an authoritative AWS data source. To disable the HTTP check for the region pass nil as the client and the region will be checked against a static set of well known AWS regions only.
Types ¶
type ARN ¶
type ARN struct { Partition string Service string Region string AccountID string ResourceType string Resource string // contains filtered or unexported fields }
ARN is a struct representing structure of an ARN.
func Parse ¶
Parse validates an ARN string and returns an ARN type. An http.Client can be provided to validate the region against the latest regions queries from an AWS endpoint. To disable this HTTP request pass nil as the client and the region will be validated against a static set of well known AWS regions.
type AWSIPRanges ¶
type AWSIPRanges struct { SyncToken string `json:"syncToken"` CreateDateStr string `json:"createDate"` CreateDate time.Time Prefixes []struct { IPPrefix string `json:"ip_prefix"` IP net.IP Network *net.IPNet Region string `json:"region"` Service string `json:"service"` } `json:"prefixes"` Ipv6Prefixes []struct { Ipv6Prefix string `json:"ipv6_prefix"` IP net.IP Network *net.IPNet Region string `json:"region"` Service string `json:"service"` } `json:"ipv6_prefixes"` }
AWSIPRanges represents the AWS ip-ranges.json document.
func AWSIPRangesDoc ¶
func AWSIPRangesDoc(client *http.Client) (awsip AWSIPRanges, err error)
AWSIPRangesDoc reads the ip-ranges.json document from https://ip-ranges.amazonaws.com/ip-ranges.json and returns an AWSIPRanges type.
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
func NewTerminal ¶
func NewTerminal() *Terminal
NewTerminal init a new terminal utils for sugar purposes