cloud

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2017 WALLIX

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	Region string = "region"
	//infra
	Vpc              string = "vpc"
	Subnet           string = "subnet"
	Image            string = "image"
	ImportImageTask  string = "importimagetask"
	SecurityGroup    string = "securitygroup"
	AvailabilityZone string = "availabilityzone"
	Keypair          string = "keypair"
	Volume           string = "volume"
	Instance         string = "instance"
	InstanceProfile  string = "instanceprofile"
	InternetGateway  string = "internetgateway"
	NatGateway       string = "natgateway"
	RouteTable       string = "routetable"
	ElasticIP        string = "elasticip"
	Snapshot         string = "snapshot"
	NetworkInterface string = "networkinterface"
	Certificate      string = "certificate"
	//loadbalancer
	LoadBalancer string = "loadbalancer"
	TargetGroup  string = "targetgroup"
	Listener     string = "listener"
	//database
	Database      string = "database"
	DbSubnetGroup string = "dbsubnetgroup"
	//access
	User         string = "user"
	Role         string = "role"
	Group        string = "group"
	Policy       string = "policy"
	AccessKey    string = "accesskey"
	LoginProfile string = "loginprofile"
	MFADevice    string = "mfadevice"
	//storage
	Bucket   string = "bucket"
	S3Object string = "s3object"
	Acl      string = "storageacl"
	//notification
	Subscription string = "subscription"
	Topic        string = "topic"
	//queue
	Queue string = "queue"
	//dns
	Zone   string = "zone"
	Record string = "record"
	//lambda
	Function string = "function"
	//autoscaling
	LaunchConfiguration string = "launchconfiguration"
	ScalingGroup        string = "scalinggroup"
	ScalingPolicy       string = "scalingpolicy"
	//monitoring
	Metric string = "metric"
	Alarm  string = "alarm"
	//cdn
	Distribution string = "distribution"
	//cloudformation
	Stack string = "stack"
	//container
	Repository        string = "repository"
	Registry          string = "registry"
	ContainerCluster  string = "containercluster"
	ContainerService  string = "containerservice"
	ContainerTask     string = "containertask"
	Container         string = "container"
	ContainerInstance string = "containerinstance"
	//application autoscaling
	AppScalingTarget string = "appscalingtarget"
	AppScalingPolicy string = "appscalingpolicy"
)

Resources

Variables

View Source
var ErrFetchAccessDenied = errors.New("access denied to cloud resource")
View Source
var ServiceRegistry = make(map[string]Service)

Functions

func PluralizeResource

func PluralizeResource(singular string) string

func SingularizeResource added in v0.1.1

func SingularizeResource(plural string) string

Types

type GraphAPI added in v0.1.9

type GraphAPI interface {
	Find(Query) ([]Resource, error)
	FindWithProperties(map[string]interface{}) ([]Resource, error)
	FilterGraph(Query) (GraphAPI, error)
	FindOne(Query) (Resource, error)
	MarshalTo(w io.Writer) error
	ResourceRelations(r Resource, relation string, recursive bool) ([]Resource, error)
	VisitRelations(Resource, string, bool, func(Resource, int) error) error
	ResourceSiblings(Resource) ([]Resource, error)
	Merge(GraphAPI) error
}

type LazyGraph added in v0.1.9

type LazyGraph struct {
	LoadingFunc func() GraphAPI
	// contains filtered or unexported fields
}

func (*LazyGraph) FilterGraph added in v0.1.9

func (g *LazyGraph) FilterGraph(q Query) (GraphAPI, error)

func (*LazyGraph) Find added in v0.1.9

func (g *LazyGraph) Find(q Query) ([]Resource, error)

func (*LazyGraph) FindOne added in v0.1.9

func (g *LazyGraph) FindOne(q Query) (Resource, error)

func (*LazyGraph) FindWithProperties added in v0.1.9

func (g *LazyGraph) FindWithProperties(props map[string]interface{}) ([]Resource, error)

func (*LazyGraph) MarshalTo added in v0.1.9

func (g *LazyGraph) MarshalTo(w io.Writer) error

func (*LazyGraph) Merge added in v0.1.9

func (g *LazyGraph) Merge(aG GraphAPI) error

func (*LazyGraph) ResourceRelations added in v0.1.9

func (g *LazyGraph) ResourceRelations(r Resource, relation string, recursive bool) ([]Resource, error)

func (*LazyGraph) ResourceSiblings added in v0.1.9

func (g *LazyGraph) ResourceSiblings(r Resource) ([]Resource, error)

func (*LazyGraph) VisitRelations added in v0.1.9

func (g *LazyGraph) VisitRelations(r Resource, relation string, includeResource bool, each func(Resource, int) error) error

type Matcher added in v0.1.9

type Matcher interface {
	Match(r Resource) bool
}

type Query added in v0.1.9

type Query struct {
	ResourceType []string
	Matcher      Matcher
}

func NewQuery added in v0.1.9

func NewQuery(resourceType ...string) Query

func (Query) Match added in v0.1.9

func (q Query) Match(m Matcher) Query

type Resource added in v0.1.9

type Resource interface {
	Type() string
	Id() string
	String() string
	Format(string) string
	Properties() map[string]interface{}
	Property(string) (interface{}, bool)
	Meta(string) (interface{}, bool)
	Same(Resource) bool
}

type Resources added in v0.1.9

type Resources []Resource

func (Resources) Map added in v0.1.9

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

type Service

type Service interface {
	Region() string
	Profile() string
	Name() string
	ResourceTypes() []string
	IsSyncDisabled() bool
	Fetch(context.Context) (GraphAPI, error)
	FetchByType(context.Context, string) (GraphAPI, error)
}

func AllServices added in v0.1.2

func AllServices() (out []Service)

func GetServiceForType

func GetServiceForType(t string) (Service, error)

type Services added in v0.0.21

type Services []Service

func (Services) Names added in v0.0.21

func (srvs Services) Names() (names []string)

Directories

Path Synopsis
DO NOT EDIT This file was automatically generated with go generate
DO NOT EDIT This file was automatically generated with go generate
DO NOT EDIT This file was automatically generated with go generate
DO NOT EDIT This file was automatically generated with go generate

Jump to

Keyboard shortcuts

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