util

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlattenClusterEndpoint

func FlattenClusterEndpoint(metadata *models.ClusterMetadataInfo) map[string]interface{}

FlattenClusterEndpoint receives a ClusterMetadataInfo, parses the http and https endpoints and returns a map with two keys: `http_endpoint` and `https_endpoint`

func IsCurrentApmPlanEmpty

func IsCurrentApmPlanEmpty(res *models.ApmResourceInfo) bool

IsCurrentApmPlanEmpty checks the apm resource current plan is empty.

func IsCurrentEsPlanEmpty

func IsCurrentEsPlanEmpty(res *models.ElasticsearchResourceInfo) bool

IsCurrentEsPlanEmpty checks that the elasticsearch resource current plan is empty.

func IsCurrentEssPlanEmpty

func IsCurrentEssPlanEmpty(res *models.EnterpriseSearchResourceInfo) bool

IsCurrentEssPlanEmpty checks the enterprise search resource current plan is empty.

func IsCurrentKibanaPlanEmpty

func IsCurrentKibanaPlanEmpty(res *models.KibanaResourceInfo) bool

IsCurrentKibanaPlanEmpty checks the kibana resource current plan is empty.

func ItemsToString

func ItemsToString(elems []interface{}) (result []string)

ItemsToString takes in an []interface{} and returns a slice of strings.

func MemoryToState

func MemoryToState(mem int32) string

MemoryToState parses a megabyte int notation to a gigabyte notation.

func NewResourceData

func NewResourceData(t *testing.T, params ResDataParams) *schema.ResourceData

NewResourceData creates a ResourceData from a raw configuration map and schema.

func ObjectRemoved

func ObjectRemoved(d *schema.ResourceData, key string) bool

ObjectRemoved takes in a ResourceData and a key string, returning whether or not the object ([]intreface{} type) is being removed in the current change.

func ParseTopologySize

func ParseTopologySize(topology map[string]interface{}) (*models.TopologySize, error)

ParseTopologySize parses a flattened topology into its model.

func StringToItems

func StringToItems(elems ...string) (result []interface{})

StringToItems takes in a slice of strings and returns a []interface{}.

func TrafficFilterNotFound

func TrafficFilterNotFound(err error) bool

TrafficFilterNotFound returns true when the error is a 404 or 403.

Types

type ResDataParams

type ResDataParams struct {
	// ID to set for the resource.
	ID string

	// The resource's schema.
	Schema map[string]*schema.Schema

	// The current resource state, to simulate a create or a case where no
	// previous state has been persisted, only State should be specified.
	State map[string]interface{}

	// The desired resource configuration, this is useful to simulate "update"
	// changes on a given resource.
	Change map[string]interface{}
}

ResDataParams holds the raw configuration for NewResourceData to consume

func (ResDataParams) Validate

func (params ResDataParams) Validate() error

Validate the parameters

Jump to

Keyboard shortcuts

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