arn

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2017 License: BSD-2-Clause Imports: 2 Imported by: 10

Documentation

Overview

package arn 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 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 Parse

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

Parse 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