graph

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EgressOnlyInternetGatewayTarget routeTargetType = iota
	GatewayTarget
	InstanceTarget
	NatTarget
	NetworkInterfaceTarget
	VpcPeeringConnectionTarget
)

Variables

View Source
var Differ = &differ{rdf.DefaultDiffer}

Functions

func VisitorCollectFunc

func VisitorCollectFunc(collect *[]*Resource) visitEachFunc

Types

type Alias

type Alias string

func (Alias) ResolveToId

func (a Alias) ResolveToId(g *Graph, resT string) (string, bool)

type And

type And struct {
	Resolvers []Resolver
}

func (*And) Resolve

func (r *And) Resolve(g *Graph) (result []*Resource, err error)

type ById

type ById struct {
	Id string
}

func (*ById) Resolve

func (r *ById) Resolve(g *Graph) ([]*Resource, error)

type ByProperty

type ByProperty struct {
	Name string
	Val  interface{}
}

func (*ByProperty) Resolve

func (r *ByProperty) Resolve(g *Graph) ([]*Resource, error)

type ByType

type ByType struct {
	Typ string
}

func (*ByType) Resolve

func (r *ByType) Resolve(g *Graph) ([]*Resource, error)

type ByTypes added in v0.0.20

type ByTypes struct {
	Typs []string
}

func (*ByTypes) Resolve added in v0.0.20

func (r *ByTypes) Resolve(g *Graph) ([]*Resource, error)

type ChildrenVisitor

type ChildrenVisitor struct {
	From        *Resource
	Each        visitEachFunc
	IncludeFrom bool
}

func (*ChildrenVisitor) Visit

func (v *ChildrenVisitor) Visit(g *Graph) error

type Diff

type Diff struct {
	*rdf.Diff
}

func NewDiff

func NewDiff(fromG, toG *Graph) *Diff

func (*Diff) FromGraph

func (d *Diff) FromGraph() *Graph

func (*Diff) MergedGraph

func (d *Diff) MergedGraph() *Graph

func (*Diff) ToGraph

func (d *Diff) ToGraph() *Graph

type FilterFn

type FilterFn func(*Resource) bool

func BuildPropertyFilterFunc

func BuildPropertyFilterFunc(key, val string) FilterFn

type FirewallRule

type FirewallRule struct {
	PortRange PortRange
	Protocol  string
	IPRanges  []*net.IPNet // IPv4 or IPv6 range
}

func (*FirewallRule) String

func (r *FirewallRule) String() string

type Grant

type Grant struct {
	Permission,
	GranteeID,
	GranteeDisplayName,
	GranteeType string
}

func (*Grant) String

func (g *Grant) String() string

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph() *Graph

func NewGraphFromFile

func NewGraphFromFile(filepath string) (*Graph, error)

func (*Graph) Accept

func (g *Graph) Accept(v Visitor) error

func (*Graph) AddAppliesOnRelation

func (g *Graph) AddAppliesOnRelation(parent, child *Resource) error

func (*Graph) AddGraph

func (g *Graph) AddGraph(gph *Graph)

func (*Graph) AddParentRelation

func (g *Graph) AddParentRelation(parent, child *Resource) error

func (*Graph) AddResource

func (g *Graph) AddResource(resources ...*Resource) error

func (*Graph) Filter

func (g *Graph) Filter(entity string, filters ...FilterFn) (*Graph, error)

func (*Graph) FindResource

func (g *Graph) FindResource(id string) (*Resource, error)

func (*Graph) FindResourcesByProperty

func (g *Graph) FindResourcesByProperty(key string, value interface{}) ([]*Resource, error)

func (*Graph) GetAllResources

func (g *Graph) GetAllResources(typs ...string) ([]*Resource, error)

func (*Graph) GetResource

func (g *Graph) GetResource(t string, id string) (*Resource, error)

func (*Graph) ListResourcesAppliedOn

func (g *Graph) ListResourcesAppliedOn(start *Resource) ([]*Resource, error)

func (*Graph) ListResourcesDependingOn

func (g *Graph) ListResourcesDependingOn(start *Resource) ([]*Resource, error)

func (*Graph) Marshal

func (g *Graph) Marshal() ([]byte, error)

func (*Graph) MustMarshal

func (g *Graph) MustMarshal() string

func (*Graph) ResolveResources

func (g *Graph) ResolveResources(resolvers ...Resolver) ([]*Resource, error)

func (*Graph) Unmarshal

func (g *Graph) Unmarshal(data []byte) error

type ParentsVisitor

type ParentsVisitor struct {
	From        *Resource
	Each        visitEachFunc
	IncludeFrom bool
}

func (*ParentsVisitor) Visit

func (v *ParentsVisitor) Visit(g *Graph) error

type PortRange

type PortRange struct {
	FromPort, ToPort int64
	Any              bool
}

type Properties

type Properties map[string]interface{}

func (Properties) Subtract

func (props Properties) Subtract(other Properties) Properties

type Property

type Property struct {
	Key   string
	Value interface{}
}

type Resolver

type Resolver interface {
	Resolve(g *Graph) ([]*Resource, error)
}

type Resource

type Resource struct {
	Properties Properties
	Meta       Properties
	// contains filtered or unexported fields
}

func InitResource

func InitResource(id string, kind string) *Resource

func (*Resource) Id

func (res *Resource) Id() string

func (*Resource) Same

func (res *Resource) Same(other *Resource) bool

Compare only the id and type of the resources (no properties nor meta)

func (*Resource) String

func (res *Resource) String() string

func (*Resource) Type

func (res *Resource) Type() string

type ResourceById

type ResourceById []*Resource

func (ResourceById) Len

func (r ResourceById) Len() int

func (ResourceById) Less

func (r ResourceById) Less(i, j int) bool

func (ResourceById) Swap

func (r ResourceById) Swap(i, j int)

type ResourceType

type ResourceType string

func (ResourceType) String

func (r ResourceType) String() string

type Resources

type Resources []*Resource

func (Resources) Map

func (res Resources) Map(f func(*Resource) string) (out []string)

type Route

type Route struct {
	Destination             *net.IPNet
	DestinationIPv6         *net.IPNet
	DestinationPrefixListId string
	Targets                 []*RouteTarget
}

func (*Route) String

func (r *Route) String() string

type RouteTarget

type RouteTarget struct {
	Type  routeTargetType
	Ref   string
	Owner string
}

func (*RouteTarget) String

func (t *RouteTarget) String() string

type SiblingsVisitor

type SiblingsVisitor struct {
	From        *Resource
	Each        visitEachFunc
	IncludeFrom bool
}

func (*SiblingsVisitor) Visit

func (v *SiblingsVisitor) Visit(g *Graph) error

type Visitor

type Visitor interface {
	Visit(*Graph) error
}

Directories

Path Synopsis
internal
rdf

Jump to

Keyboard shortcuts

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