utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustCombineMaps

func MustCombineMaps[T interface{}](m1, m2 map[string]T) map[string]T

MustCombineMaps attempts to combine two maps. Panics if maps can not be combined.

func StartTunnel

func StartTunnel(ctx context.Context, d *schema.ResourceData, config *google.Config) (proxyURL string, err error)

StartTunnel and returns the proxy url nolint: cyclop

func WrapSchemaResource

func WrapSchemaResource(resource *schema.Resource) *schema.Resource

WrapSchemaResource wraps a schema.resource to extract the underlying provider interface. This way, we can configure context on both the underlying provider interfaces without modifying the underlying provider. This allows are only modification to the provider itself to be the addition of the proxy_url field and the proxy starter. nolint: staticcheck, wrapcheck, gocognit, cyclop

Types

type CombinedSchema

type CombinedSchema struct {
	Schema     map[string]*schema.Schema
	MetaSchema map[string]*schema.Schema

	ResourceMap, DataSourceMap map[string]*schema.Resource
}

func CombineSchemas

func CombineSchemas(googleProvider, underlyingProvider *schema.Provider, toReplace, replaceWith string) (co CombinedSchema)

CombineSchemas provides 2 helm schemas toReplace and replaceWith are used to specify to the provider to replace note: while this does not enforce which provider is used, it will fail if one provider is not a google-like provider (in terms of the fields it has)

type WrappedProvider

type WrappedProvider interface {
	// UnderlyingProvider gets the underlying provider
	UnderlyingProvider() interface{}
	GoogleProvider() interface{}
}

Jump to

Keyboard shortcuts

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