namevaluesfilters

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

README

namevaluesfilters

The namevaluesfilters package is designed to provide a consistent interface for handling AWS resource filtering.

This package implements a single NameValuesFilters type, which covers all filter handling logic, such as merging filters, via functions on the single type. The underlying implementation is compatible with Go operations such as len().

Full documentation for this package can be found on GoDoc.

Many AWS Go SDK services that support resource filtering have their service-specific Go type conversion functions to and from NameValuesFilters code generated. Converting from NameValuesFilters to AWS Go SDK types is done via {SERVICE}Filters() functions on the type. For more information about this code generation, see the generators/servicefilters README.

Any filtering functions that cannot be generated should be hand implemented in a service-specific source file (e.g. ec2_filters.go) and follow the format of similar generated code wherever possible. The first line of the source file should be // +build !generate. This prevents the file's inclusion during the code generation phase.

Code Structure

internal/generate/namevaluesfilters
├── generators
│   └── servicefilters (generates service_filters_gen.go)
├── name_values_filters_test.go (unit tests for core logic)
├── name_values_filters.go (core logic)
├── service_generation_customizations.go (shared AWS Go SDK service customizations for generators)
├── service_filters_gen.go (generated AWS Go SDK service conversion functions)
└── <service name>_filters.go (any service-specific functions that cannot be generated)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Schema

func Schema() *schema.Schema

Schema returns a *schema.Schema that represents a set of custom filtering criteria that a user can specify as input to a data source. It is conventional for an attribute of this type to be included as a top-level attribute called "filter".

func ServiceFilterPackage

func ServiceFilterPackage(serviceName string) string

ServiceFilterPackage determines the service filter type package.

func ServiceFilterType

func ServiceFilterType(serviceName string) string

ServiceFilterType determines the service filter type.

func ServiceFilterTypeNameField

func ServiceFilterTypeNameField(serviceName string) string

ServiceFilterTypeNameField determines the service filter type name field.

func ServiceFilterTypeValuesField

func ServiceFilterTypeValuesField(serviceName string) string

ServiceFilterTypeValuesField determines the service filter type values field.

Types

type NameValuesFilters

type NameValuesFilters map[string][]string

NameValuesFilters is a standard implementation for AWS resource filters. The AWS Go SDK is split into multiple service packages, each service with its own Go struct type representing a resource filter. To standardize logic across all these Go types, we convert them into this Go type.

func EC2Tags

func EC2Tags(tags map[string]string) NameValuesFilters

EC2Tags creates NameValuesFilters from a map of keyvalue tags.

func New

func New(i interface{}) NameValuesFilters

New creates NameValuesFilters from common Terraform Provider SDK types. Supports map[string]string, map[string][]string, *schema.Set.

func (NameValuesFilters) Add

func (filters NameValuesFilters) Add(i interface{}) NameValuesFilters

Add adds missing and updates existing filters from common Terraform Provider SDK types. Supports map[string]string, map[string][]string, *schema.Set.

func (NameValuesFilters) AutoScalingFilters

func (filters NameValuesFilters) AutoScalingFilters() []*autoscaling.Filter

AutoScalingFilters returns autoscaling service filters.

func (NameValuesFilters) DatabasemigrationserviceFilters

func (filters NameValuesFilters) DatabasemigrationserviceFilters() []*databasemigrationservice.Filter

DatabasemigrationserviceFilters returns databasemigrationservice service filters.

func (NameValuesFilters) DocDBFilters

func (filters NameValuesFilters) DocDBFilters() []*docdb.Filter

DocDBFilters returns docdb service filters.

func (NameValuesFilters) EC2Filters

func (filters NameValuesFilters) EC2Filters() []*ec2.Filter

EC2Filters returns ec2 service filters.

func (NameValuesFilters) ElasticinferenceFilters

func (filters NameValuesFilters) ElasticinferenceFilters() []*elasticinference.Filter

ElasticinferenceFilters returns elasticinference service filters.

func (NameValuesFilters) ElasticsearchserviceFilters

func (filters NameValuesFilters) ElasticsearchserviceFilters() []*elasticsearchservice.Filter

ElasticsearchserviceFilters returns elasticsearchservice service filters.

func (NameValuesFilters) FSxFilters

func (filters NameValuesFilters) FSxFilters() []*fsx.Filter

FSxFilters returns fsx service filters.

func (NameValuesFilters) ImagebuilderFilters

func (filters NameValuesFilters) ImagebuilderFilters() []*imagebuilder.Filter

ImagebuilderFilters returns imagebuilder service filters.

func (NameValuesFilters) LicensemanagerFilters

func (filters NameValuesFilters) LicensemanagerFilters() []*licensemanager.Filter

LicensemanagerFilters returns licensemanager service filters.

func (NameValuesFilters) Map

func (filters NameValuesFilters) Map() map[string][]string

Map returns filter names mapped to their values. Duplicate values are eliminated and empty values removed.

func (NameValuesFilters) NeptuneFilters

func (filters NameValuesFilters) NeptuneFilters() []*neptune.Filter

NeptuneFilters returns neptune service filters.

func (NameValuesFilters) RDSFilters

func (filters NameValuesFilters) RDSFilters() []*rds.Filter

RDSFilters returns rds service filters.

func (NameValuesFilters) ResourcegroupstaggingapiFilters

func (filters NameValuesFilters) ResourcegroupstaggingapiFilters() []*resourcegroupstaggingapi.TagFilter

ResourcegroupstaggingapiFilters returns resourcegroupstaggingapi service filters.

func (NameValuesFilters) Route53resolverFilters

func (filters NameValuesFilters) Route53resolverFilters() []*route53resolver.Filter

Route53resolverFilters returns route53resolver service filters.

func (NameValuesFilters) SecretsmanagerFilters

func (filters NameValuesFilters) SecretsmanagerFilters() []*secretsmanager.Filter

SecretsmanagerFilters returns secretsmanager service filters.

Jump to

Keyboard shortcuts

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