google

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ProviderName = "google"
)

ProviderName uniquely identifies this provider implementation.

View Source
const RegistryName = "registry.terraform.io/hashicorp/google"

RegistryName is the fully qualified name under which this provider is stored in the registry.

Variables

View Source
var (
	// ErrNotSupportedService reports that the service is not supported
	ErrNotSupportedService = errors.New("not supported service")
)
View Source
var TerraformProviderInitializer = terraform.ProviderInitializer{
	MatchNames: []string{ProviderName, RegistryName},
	Provider: func(values map[string]string) (terraform.Provider, error) {
		z, ok := values["zone"]
		if !ok {
			return nil, nil
		}
		region := zoneToRegion(z)
		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

func (*Ingester) Err

func (ing *Ingester) Err() error

Err returns any error that might have happened during the ingestion.

func (*Ingester) Ingest

func (ing *Ingester) Ingest(ctx context.Context, chSize int) <-chan *price.WithProduct

Ingest will initialize the process of ingesting and it'll push the price.WithProduct found to the returned channel

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

const (
	ComputeEngine Service = iota // Compute Engine
)

List of all the supported services

func ServiceString

func ServiceString(s string) (Service, error)

ServiceString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ServiceValues

func ServiceValues() []Service

ServiceValues returns all values of the enum

func (Service) IsAService

func (i Service) IsAService() bool

IsAService returns "true" if the value is listed in the enum definition. "false" otherwise

func (Service) String

func (i Service) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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