util

package
v0.0.2-pre Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataSourceSchemaWrap

func DataSourceSchemaWrap(s map[string]*schema.Schema) map[string]*schema.Schema

func If

func If(condition bool, trueVal, falseVal interface{}) interface{}

func IsValidName

func IsValidName(i interface{}, k string) ([]string, []error)

func NamespacedSchemaWrap

func NamespacedSchemaWrap(s map[string]*schema.Schema, system bool)

func NewObjectMeta

func NewObjectMeta(namespace, name string) metav1.ObjectMeta

func NonNamespacedSchemaWrap

func NonNamespacedSchemaWrap(s map[string]*schema.Schema)

func ResourceConstruct

func ResourceConstruct(d *schema.ResourceData, c Constructor) (interface{}, error)

func ResourceStatesSet

func ResourceStatesSet(d *schema.ResourceData, getter *importer.StateGetter) error

Types

type Constructor

type Constructor interface {
	Setup() Processors
	Result() (interface{}, error)
	Validate() error
}

type Processor

type Processor struct {
	Parser   func(interface{}) error
	Field    string
	Required bool
}

type Processors

type Processors []Processor

func NewProcessors

func NewProcessors() Processors

func (Processors) Bool

func (p Processors) Bool(key string, dst *bool, required bool) Processors

func (Processors) Description

func (p Processors) Description(annotations *map[string]string) Processors

func (Processors) String

func (p Processors) String(key string, dst *string, required bool) Processors

func (Processors) Tags

func (p Processors) Tags(labels *map[string]string) Processors

Jump to

Keyboard shortcuts

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