Documentation ¶
Index ¶
- Constants
- Variables
- func VisitorCollectFunc(collect *[]*Resource) visitEachFunc
- type Alias
- type ChildrenVisitor
- type Diff
- type FirewallRule
- type Grant
- type Graph
- func (g *Graph) Accept(v Visitor) error
- func (g *Graph) AddAppliesOnRelation(parent, child *Resource) error
- func (g *Graph) AddGraph(graph *Graph)
- func (g *Graph) AddParentRelation(parent, child *Resource) error
- func (g *Graph) AddResource(resources ...*Resource) error
- func (g *Graph) CountChildrenForNode(res *Resource) (int, error)
- func (g *Graph) CountChildrenOfTypeForNode(res *Resource, childType ResourceType) (int, error)
- func (g *Graph) FindResource(id string) (*Resource, error)
- func (g *Graph) FindResourcesByProperty(key string, value interface{}) ([]*Resource, error)
- func (g *Graph) GetAllResources(t ResourceType) ([]*Resource, error)
- func (g *Graph) GetResource(t ResourceType, id string) (*Resource, error)
- func (g *Graph) ListResourcesAppliedOn(start *Resource) ([]*Resource, error)
- func (g *Graph) ListResourcesDependingOn(start *Resource) ([]*Resource, error)
- func (g *Graph) Marshal() ([]byte, error)
- func (g *Graph) MustMarshal() string
- func (g *Graph) Unmarshal(data []byte) error
- type ParentsVisitor
- type PortRange
- type Properties
- type Property
- type Resource
- type ResourceById
- type ResourceType
- type Resources
- type Route
- type SiblingsVisitor
- type Visitor
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 ResourceType) (string, bool)
type ChildrenVisitor ¶
func (*ChildrenVisitor) Visit ¶
func (v *ChildrenVisitor) Visit(g *Graph) error
type Diff ¶
func (*Diff) MergedGraph ¶
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 Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
func NewGraphFromFile ¶
func (*Graph) AddAppliesOnRelation ¶
func (*Graph) AddParentRelation ¶
func (*Graph) AddResource ¶
func (*Graph) CountChildrenForNode ¶
func (*Graph) CountChildrenOfTypeForNode ¶
func (g *Graph) CountChildrenOfTypeForNode(res *Resource, childType ResourceType) (int, error)
func (*Graph) FindResourcesByProperty ¶
func (*Graph) GetAllResources ¶
func (g *Graph) GetAllResources(t ResourceType) ([]*Resource, error)
func (*Graph) GetResource ¶
func (g *Graph) GetResource(t ResourceType, id string) (*Resource, error)
func (*Graph) ListResourcesAppliedOn ¶
func (*Graph) ListResourcesDependingOn ¶
func (*Graph) MustMarshal ¶
type ParentsVisitor ¶
func (*ParentsVisitor) Visit ¶
func (v *ParentsVisitor) Visit(g *Graph) error
type Properties ¶
type Properties map[string]interface{}
func (Properties) Substract ¶
func (props Properties) Substract(other Properties) Properties
type Resource ¶
type Resource struct { Properties Properties Meta Properties // contains filtered or unexported fields }
func InitResource ¶
func InitResource(id string, kind ResourceType) *Resource
func (*Resource) Type ¶
func (res *Resource) Type() ResourceType
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
const ( Region ResourceType = "region" //infra Vpc ResourceType = "vpc" Subnet ResourceType = "subnet" Image ResourceType = "image" SecurityGroup ResourceType = "securitygroup" Keypair ResourceType = "keypair" Volume ResourceType = "volume" Instance ResourceType = "instance" InternetGateway ResourceType = "internetgateway" RouteTable ResourceType = "routetable" //access User ResourceType = "user" Role ResourceType = "role" Group ResourceType = "group" Policy ResourceType = "policy" //s3 Bucket ResourceType = "bucket" Object ResourceType = "storageobject" Acl ResourceType = "storageacl" )
func (ResourceType) String ¶
func (r ResourceType) String() string
func (ResourceType) ToRDFString ¶
func (r ResourceType) ToRDFString() string
type SiblingsVisitor ¶
func (*SiblingsVisitor) Visit ¶
func (v *SiblingsVisitor) Visit(g *Graph) error
Click to show internal directories.
Click to hide internal directories.