Documentation ¶
Index ¶
Constants ¶
const (
ProviderName = "google"
)
ProviderName uniquely identifies this provider implementation.
const RegistryName = "registry.terraform.io/hashicorp/google"
RegistryName is the fully qualified name under which this provider is stored in the registry.
Variables ¶
var ( // ErrNotSupportedService reports that the service is not supported ErrNotSupportedService = errors.New("not supported service") )
var TerraformProviderInitializer = terraform.ProviderInitializer{ MatchNames: []string{ProviderName, RegistryName}, Provider: func(values map[string]interface{}) (terraform.Provider, error) { z, ok := values["zone"] if !ok { return nil, nil } region, err := zoneToRegion(z.(string)) if err != nil { return nil, fmt.Errorf("unable to get region from zone: %w", err) } return googletf.NewProvider(ProviderName, region) }, }
TerraformProviderInitializer is a terraform.ProviderInitializer that initializes the default GCP provider.
Functions ¶
func DefaultFilter ¶
func DefaultFilter(_ *price.WithProduct) bool
DefaultFilter ingests all the records without filtering.
func MinimalFilter ¶
func MinimalFilter(pp *price.WithProduct) bool
MinimalFilter will filter just the supported prices for the current google implementation
func ServiceStrings ¶
func ServiceStrings() []string
ServiceStrings returns a slice of all String values of the enum
Types ¶
type Ingester ¶
type Ingester struct {
// contains filtered or unexported fields
}
Ingester is the entity that will manage the ingestion process from Google
func NewIngester ¶
func NewIngester(ctx context.Context, credentialJSON []byte, service, project, zone string, opts ...Option) (*Ingester, error)
NewIngester will initialize the Ingester for Google
type IngestionFilter ¶
type IngestionFilter func(pp *price.WithProduct) bool
IngestionFilter allows control over what pricing data is ingested. Given a price.WithProduct the function returns true if the record should be ingested, false if it should be skipped.
type Option ¶
type Option func(ing *Ingester)
Option is used to configure the Ingester.
func WithGCPOption ¶
func WithGCPOption(opts ...option.ClientOption) Option
WithGCPOption will proxy the GCP ClientOption to the service initializations
func WithIngestionFilter ¶
func WithIngestionFilter(filter IngestionFilter) Option
WithIngestionFilter sets a custom IngestionFilter to control which pricing data records should be ingested.
type Service ¶
type Service uint8
Service is the type defining the services
func ServiceString ¶
ServiceString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Service) IsAService ¶
IsAService returns "true" if the value is listed in the enum definition. "false" otherwise