resource

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 12 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsResourceTypeSupported

func IsResourceTypeSupported(ty string) bool

Types

type AttributeSchema

type AttributeSchema struct {
	ConfigSchema configschema.Attribute
	JsonString   bool
}

type Attributes

type Attributes map[string]interface{}

func (*Attributes) Copy

func (a *Attributes) Copy() *Attributes

func (*Attributes) DeleteIfDefault

func (a *Attributes) DeleteIfDefault(path string)

func (*Attributes) Get

func (a *Attributes) Get(path string) (interface{}, bool)

func (*Attributes) GetBool

func (a *Attributes) GetBool(path string) *bool

func (*Attributes) GetFloat64

func (a *Attributes) GetFloat64(path string) *float64

func (*Attributes) GetInt

func (a *Attributes) GetInt(path string) *int

func (*Attributes) GetMap

func (a *Attributes) GetMap(path string) map[string]interface{}

func (*Attributes) GetSlice

func (a *Attributes) GetSlice(path string) []interface{}

func (*Attributes) GetString

func (a *Attributes) GetString(path string) *string

func (*Attributes) SafeDelete

func (a *Attributes) SafeDelete(path []string)

func (*Attributes) SafeSet

func (a *Attributes) SafeSet(path []string, value interface{}) error

func (*Attributes) SanitizeDefaults

func (a *Attributes) SanitizeDefaults()

type Deserializer

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

func NewDeserializer

func NewDeserializer(factory ResourceFactory) *Deserializer

func (*Deserializer) Deserialize

func (s *Deserializer) Deserialize(ty string, rawList []cty.Value) ([]*Resource, error)

func (*Deserializer) DeserializeOne

func (s *Deserializer) DeserializeOne(ty string, value cty.Value) (*Resource, error)

type Flags

type Flags uint32

func (*Flags) AddFlag

func (f *Flags) AddFlag(flag Flags)

func (Flags) HasFlag

func (f Flags) HasFlag(flag Flags) bool

type MockSupplier

type MockSupplier struct {
	mock.Mock
}

MockSupplier is an autogenerated mock type for the Supplier type

func NewMockSupplier added in v0.39.0

func NewMockSupplier(t mockConstructorTestingTNewMockSupplier) *MockSupplier

NewMockSupplier creates a new instance of MockSupplier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockSupplier) Resources

func (_m *MockSupplier) Resources() ([]*Resource, error)

Resources provides a mock function with given fields:

type NormalizedResource

type NormalizedResource interface {
	NormalizeForState() (Resource, error)
	NormalizeForProvider() (Resource, error)
}

type Resource

type Resource struct {
	Id     string
	Type   string
	Attrs  *Attributes
	Sch    *Schema `json:"-" diff:"-"`
	Source Source  `json:"-"`
}

func Sort

func Sort(res []*Resource) []*Resource

func (*Resource) Attributes

func (r *Resource) Attributes() *Attributes

func (*Resource) Equal

func (r *Resource) Equal(res *Resource) bool

func (*Resource) ResourceId

func (r *Resource) ResourceId() string

func (*Resource) ResourceType

func (r *Resource) ResourceType() string

func (*Resource) Schema

func (r *Resource) Schema() *Schema

func (*Resource) SourceString

func (r *Resource) SourceString() string

func (*Resource) Src

func (r *Resource) Src() Source

type ResourceFactory

type ResourceFactory interface {
	CreateAbstractResource(ty, id string, data map[string]interface{}) *Resource
}

type ResourceType

type ResourceType string

func (ResourceType) String

func (ty ResourceType) String() string

type ResourceTypeMeta

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

func GetMeta

func GetMeta(ty ResourceType) ResourceTypeMeta

func (ResourceTypeMeta) GetChildrenTypes

func (ty ResourceTypeMeta) GetChildrenTypes() []ResourceType

type Schema

type Schema struct {
	ProviderVersion             *version.Version
	Flags                       Flags
	SchemaVersion               int64
	Attributes                  map[string]AttributeSchema
	NormalizeFunc               func(res *Resource)
	HumanReadableAttributesFunc func(res *Resource) map[string]string
	DiscriminantFunc            func(*Resource, *Resource) bool
}

func (*Schema) IsComputedField

func (s *Schema) IsComputedField(path []string) bool

func (*Schema) IsJsonStringField

func (s *Schema) IsJsonStringField(path []string) bool

type SerializableResource

type SerializableResource struct {
	Id                 string              `json:"id"`
	Type               string              `json:"type"`
	ReadableAttributes map[string]string   `json:"human_readable_attributes,omitempty"`
	Source             *SerializableSource `json:"source,omitempty"`
}

func NewSerializableResource

func NewSerializableResource(res *Resource) *SerializableResource

type SerializableSource

type SerializableSource struct {
	S    string `json:"source"`
	Ns   string `json:"namespace"`
	Name string `json:"internal_name"`
}

type Source

type Source interface {
	Source() string
	Namespace() string
	InternalName() string
}

type StoppableSupplier

type StoppableSupplier interface {
	Supplier
	Stop()
}

type Supplier

type Supplier interface {
	Resources() ([]*Resource, error)
}

Supplier supply the list of resource.Resource, it's the main interface to retrieve remote resources

type TerraformStateSource

type TerraformStateSource struct {
	State  string
	Module string
	Name   string
}

func NewTerraformStateSource

func NewTerraformStateSource(state, module, name string) *TerraformStateSource

func (*TerraformStateSource) InternalName

func (s *TerraformStateSource) InternalName() string

func (*TerraformStateSource) Namespace

func (s *TerraformStateSource) Namespace() string

func (*TerraformStateSource) Source

func (s *TerraformStateSource) Source() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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