util

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetEnv = os.Getenv

used in tests

Functions

func CheckConverionToAttrValue added in v0.6.0

func CheckConverionToAttrValue(t *testing.T, dt datasource.DataSource, attributeName string, attributeValue types.List)

Check conversion to attr.Value it should catch cases when e.g. the func under test returns types.List{}

func HashString added in v0.10.0

func HashString(str string) string

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 IsCurrentIntegrationsServerPlanEmpty added in v0.4.0

func IsCurrentIntegrationsServerPlanEmpty(res *models.IntegrationsServerResourceInfo) bool

IsCurrentIntegrationsServerPlanEmpty checks the IntegrationsServer resource current plan is empty.

func IsCurrentKibanaPlanEmpty

func IsCurrentKibanaPlanEmpty(res *models.KibanaResourceInfo) bool

IsCurrentKibanaPlanEmpty checks the kibana resource current plan is empty.

func MemoryToState

func MemoryToState(mem int32) string

MemoryToState parses a megabyte int notation to a gigabyte notation.

func MemoryToStateOptional added in v0.10.0

func MemoryToStateOptional(mem *int32) *string

func MultiGetenvOrDefault added in v0.6.0

func MultiGetenvOrDefault(keys []string, defaultValue string) string

MultiGetenvOrDefault returns the value of the first environment variable in the given list that has a non-empty value. If none of the environment variables have a value, the default value is returned.

func StringListAsType added in v0.6.0

func StringListAsType(t *testing.T, in []string) types.List

func StringMapAsType added in v0.6.0

func StringMapAsType(t *testing.T, in map[string]string) types.Map

func StringToBool added in v0.6.0

func StringToBool(str string) (bool, error)

func TrafficFilterNotFound

func TrafficFilterNotFound(err error) bool

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

Types

type ResourceKind added in v0.6.0

type ResourceKind int
const (
	ApmResourceKind ResourceKind = iota
	ElasticsearchResourceKind
	EnterpriseSearchResourceKind
	IntegrationsServerResourceKind
	KibanaResourceKind
)

func (ResourceKind) Name added in v0.6.0

func (rk ResourceKind) Name() string

Jump to

Keyboard shortcuts

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