Documentation ¶
Index ¶
- func SendAllConverted[T any](ctx context.Context, output chan<- model.Resource, converter ResourceConverter, ...) error
- type MapConverter
- type ReflectionConverter
- type ResourceConverter
- type ResourceFactory
- type TagField
- type TagFunc
- type TransformFunc
- type TransformResourceFunc
- type Transformers
- func (t *Transformers[T]) Add(funcs ...TransformFunc[T])
- func (t *Transformers[T]) AddNamed(name string, f TransformFunc[T])
- func (t *Transformers[T]) AddNamedResource(name string, f TransformResourceFunc)
- func (t *Transformers[T]) AddResource(funcs ...TransformResourceFunc)
- func (t *Transformers[T]) AddTags(f TagFunc[T])
- func (t Transformers[T]) Apply(ctx context.Context, raw T, resource *model.Resource) error
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, transformerLists ...Transformers[T]) error
Types ¶
type MapConverter ¶ added in v0.0.26
type MapConverter struct { ResourceFactory ResourceFactory IdField string DisplayIdField string TagField TagField }
type ReflectionConverter ¶
type ReflectionConverter struct { ResourceFactory ResourceFactory IdField string DisplayIdField string TagField TagField }
type ResourceConverter ¶
type ResourceFactory ¶ added in v0.2.0
ResourceFactory is a factory function configured on a ResourceConverter to create a new resource with the standard, known fields filed, namely type, region, and account ID.
type TagField ¶
type TransformFunc ¶ added in v0.2.0
TransformFunc is a function that receives a raw SDK value and uses it to mutate the passed model.Resource in some way.
func TagTransformer ¶ added in v0.2.0
func TagTransformer[T any](f TagFunc[T]) TransformFunc[T]
TagTransformer converts a TagFunc[T] into a TransformFunc[T]
type TransformResourceFunc ¶ added in v0.2.0
TransformResourceFunc is a function that modifies a model.Resource in some way
type Transformers ¶ added in v0.2.0
type Transformers[T any] struct { // contains filtered or unexported fields }
Transformers is a constructed sequence of TransformFunc and TransformResourceFunc to modify created model.Resources.
func (*Transformers[T]) Add ¶ added in v0.2.0
func (t *Transformers[T]) Add(funcs ...TransformFunc[T])
Add adds new TransformFuncs to the list, automatically assigning names to each.
func (*Transformers[T]) AddNamed ¶ added in v0.2.0
func (t *Transformers[T]) AddNamed(name string, f TransformFunc[T])
AddNamed adds the given TransformFunc to the list under the specified name.
func (*Transformers[T]) AddNamedResource ¶ added in v0.2.0
func (t *Transformers[T]) AddNamedResource(name string, f TransformResourceFunc)
AddNamedResource adds the given TransformResourceFunc to the list under the specified name.
func (*Transformers[T]) AddResource ¶ added in v0.2.0
func (t *Transformers[T]) AddResource(funcs ...TransformResourceFunc)
AddResource adds new TransformResourceFuncs to the list, automatically assigning names to each.
func (*Transformers[T]) AddTags ¶ added in v0.2.0
func (t *Transformers[T]) AddTags(f TagFunc[T])
AddTags is a convienience function to add a tag func as a transformer