lib

package
v2.3.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package lib is a Go package for parsing Amazon Resource Names.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidARN may be returned when parsing a string that is not a valid ARN.
	ErrInvalidARN = errors.New("invalid ARN")

	// ErrInvalidResource may be returned when an ARN Resrouce is not valid.
	ErrInvalidResource = errors.New("invalid ARN resource")
)

Functions

func GetHTTPClient

func GetHTTPClient() *http.Client

GetHTTPClient returns the HTTP client that should be used in Cago

func ResourceID

func ResourceID(arn string) (string, error)

ResourceID takes an ARN string and returns the resource ID from it.

func SplitResource

func SplitResource(r string) (resource, id string, err error)

SplitResource splits the Resource section of an ARN into its type and id components.

Types

type ARN

type ARN struct {
	ARN      string
	AWS      string
	Service  string
	Region   string
	Account  string
	Resource string
}

ARN represents a parsed Amazon Resource Name.

func ParseARN

func ParseARN(arn string) (*ARN, error)

ParseARN parses an Amazon Resource Name from a String into an ARN.

func (*ARN) String

func (a *ARN) String() string

String returns the string representation of an Amazon Resource Name.

Jump to

Keyboard shortcuts

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