Documentation
¶
Index ¶
- func TypeStrings() []string
- type NopProvider
- func (n NopProvider) DataSource(rsc string) (*resource.Resource, error)
- func (n NopProvider) IsEdge(rsc string) bool
- func (n NopProvider) IsNode(rsc string) bool
- func (n NopProvider) Resource(rsc string) (*resource.Resource, error)
- func (n NopProvider) ResourceInOut(rs string, cfg map[string]interface{}) (in, out []string)
- func (n NopProvider) Type() Type
- func (n NopProvider) UsedAttributes() []string
- type Provider
- type RawProvider
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TypeStrings ¶
func TypeStrings() []string
TypeStrings returns a slice of all String values of the enum
Types ¶
type NopProvider ¶
type NopProvider struct{}
NopProvider holds the default methods for the provider.Interface so if one Provider does not implement one method we do not have to write the method
func (NopProvider) DataSource ¶
func (n NopProvider) DataSource(rsc string) (*resource.Resource, error)
DataSource returns the resource information
func (NopProvider) IsEdge ¶
func (n NopProvider) IsEdge(rsc string) bool
IsEdge checks if the resource should be considered an Edge or not
func (NopProvider) IsNode ¶
func (n NopProvider) IsNode(rsc string) bool
IsNode checks if the resource should be considered a Node or not
func (NopProvider) Resource ¶
func (n NopProvider) Resource(rsc string) (*resource.Resource, error)
Resource returns the resource information
func (NopProvider) ResourceInOut ¶
func (n NopProvider) ResourceInOut(rs string, cfg map[string]interface{}) (in, out []string)
ResourceInOut returns the resource In Out from a state config. As an example in AWS this would be an "aws_security_group" "ingress" and "egress"
func (NopProvider) UsedAttributes ¶
func (n NopProvider) UsedAttributes() []string
UsedAttributes returns all the attributes that are required/used/needed on the providers, so when we have to prune we know what to keep
type Provider ¶
type Provider interface { // Type returns the name of the Provider Type() Type // IsNode checks if the resource should be considered // a Node or not IsNode(rsc string) bool // IsEdge checks if the resource should be considered // an Edge or not IsEdge(rsc string) bool // Resource returns the resource information Resource(rsc string) (*resource.Resource, error) // DataSource returns the resource information DataSource(rsc string) (*resource.Resource, error) // ResourceInOut returns the resource In Out from a // state config. As an example in AWS this would be // an "aws_security_group" "ingress" and "egress" ResourceInOut(rs string, cfg map[string]interface{}) (in, out []string) // UsedAttributes returns all the attributes that are // required/used/needed on the providers, so when we have to // prune we know what to keep UsedAttributes() []string }
Provider is an interface to abstract common functions on all the providers
type RawProvider ¶
type RawProvider struct {
NopProvider
}
RawProvider is the provider that would be used when we do not have an specific implementation a Provider
func (RawProvider) IsNode ¶
func (n RawProvider) IsNode(rsc string) bool
IsNode checks if the resource should be considered a Node or not For the default one we consider all of the Nodes
type Type ¶
type Type int
Type defines the type of the Provider
func TypeString ¶
TypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.