resourceconverter

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendAllConverted

func SendAllConverted[T any](ctx context.Context, output chan<- model.Resource, converter ResourceConverter, resources []T) error

func SendAllConvertedTags

func SendAllConvertedTags[T any](ctx context.Context, output chan<- model.Resource, converter ResourceConverter, resources []T, tF tagFunc[T]) error

Types

type ReflectionConverter

type ReflectionConverter struct {
	ResourceType string
	TagField     TagField
	IdField      string
	Region       string
}

func (*ReflectionConverter) ToResource

func (rc *ReflectionConverter) ToResource(ctx context.Context, x any, tags model.Tags) (model.Resource, error)

type ResourceConverter

type ResourceConverter interface {
	ToResource(context.Context, any, model.Tags) (model.Resource, error)
}

type TagField

type TagField struct {
	//how to fetch the tags
	//field name
	Name string `yaml:"name"`
	//name of key attribute
	Key string `yaml:"key"`
	//name of value attribute
	Value string `yaml:"value"`
}

Jump to

Keyboard shortcuts

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