cartogram

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Account string          `json:"account"`
	Region  string          `json:"region"`
	Source  string          `json:"source"`
	Roles   map[string]Role `json:"roles"`
	Tags    Tags            `json:"tags"`
}

Account defines the spec for a role assumption target

type Cartogram

type Cartogram []Account

Cartogram defines a set of Accounts

func (Cartogram) Lookup

func (c Cartogram) Lookup(accountID string) (bool, Account)

Lookup finds an account in a Cartogram based on its ID

func (Cartogram) Search

func (c Cartogram) Search(tfs TagFilterSet) Cartogram

Search finds accounts based on their tags

type Pack

type Pack map[string]Cartogram

Pack defines a group of Cartograms

func (Pack) Load

func (cp Pack) Load() error

Load populates the Cartograms from disk

func (Pack) Lookup

func (cp Pack) Lookup(accountID string) (bool, Account)

Lookup finds an account in a Pack based on its ID

func (Pack) Search

func (cp Pack) Search(tfs TagFilterSet) Cartogram

Search finds accounts based on their tags

func (Pack) Write

func (cp Pack) Write() error

Write dumps the Cartograms to disk

type Role

type Role struct {
	Mfa bool `json:"mfa"`
}

Role holds information about authenticating to a role

type TagFilter

type TagFilter struct {
	Name  string
	Value *regexp.Regexp
}

TagFilter describes a filter to apply based on an account's tags

func (TagFilter) Match

func (tf TagFilter) Match(a Account) bool

Match checks if an account matches the tag filter

type TagFilterSet

type TagFilterSet []TagFilter

TagFilterSet describes a set of tag filters

func (*TagFilterSet) LoadFromArgs

func (tfs *TagFilterSet) LoadFromArgs(args []string) error

LoadFromArgs parses key:value args into a TagFilterSet

func (TagFilterSet) Match

func (tfs TagFilterSet) Match(a Account) bool

Match checks if an account matches the tag filter set

type Tags

type Tags map[string]string

Tags are a set of metadata about an account

func (Tags) String

func (t Tags) String() string

String converts tags to a human-readable string

Jump to

Keyboard shortcuts

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