auth0

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: MPL-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v0.1.1

func Bool(d ResourceData, key string, conditions ...Condition) (b *bool)

Bool accesses the value held by key and type asserts it to a pointer to a bool.

func ConfigureProvider added in v0.26.2

func ConfigureProvider(terraformVersion string) func(data *schema.ResourceData) (interface{}, error)

ConfigureProvider will configure the *schema.Provider so that *management.Management client is stored and passed into the subsequent resources as the meta parameter.

func Diff added in v0.4.0

func Diff(d ResourceData, key string) (add Iterator, rm Iterator)

Diff accesses the value held by key and type asserts it to a set. It then compares it's changes if any and returns what needs to be added and what needs to be removed.

func Float64 added in v0.16.0

func Float64(d ResourceData, key string, conditions ...Condition) (f *float64)

Float64 accesses the value held by key and type asserts it to a pointer to a float64.

func Int added in v0.1.1

func Int(d ResourceData, key string, conditions ...Condition) (i *int)

Int accesses the value held by key and type asserts it to a pointer to a int.

func JSON added in v0.4.0

func JSON(d ResourceData, key string, conditions ...Condition) (m map[string]interface{}, err error)

JSON accesses the value held by key and unmarshals it into a map.

func Map added in v0.1.1

func Map(d ResourceData, key string, conditions ...Condition) (m map[string]interface{})

Map accesses the value held by key and type asserts it to a map.

func Provider

func Provider() *schema.Provider

Provider returns a *schema.Provider.

func Slice added in v0.1.1

func Slice(d ResourceData, key string, conditions ...Condition) (s []interface{})

Slice accesses the value held by key and type asserts it to a slice.

func String added in v0.1.1

func String(d ResourceData, key string, conditions ...Condition) (s *string)

String accesses the value held by key and type asserts it to a pointer to a string.

Types

type Condition added in v0.15.0

type Condition func(d ResourceData, key string) bool

Condition is a function that checks whether a condition holds true for a value being accessed.

It is used with accessor functions such as Int, String, etc to only retrieve the value if the conditions hold true.

func All added in v0.15.0

func All(conditions ...Condition) Condition

All is a condition that evaluates to true if all of its child conditions evaluate to true.

func Any added in v0.15.0

func Any(conditions ...Condition) Condition

Any is a condition that evaluates to true if any of its enclosed conditions evaluate to true. If it is not passed any conditions it will be considered unconditional, therefore it will evaluate to true.

func HasChange added in v0.15.0

func HasChange() Condition

HasChange is a condition that evaluates to true if the value accessed has changed.

func IsNewResource added in v0.15.0

func IsNewResource() Condition

IsNewResource is a condition that evaluates to true if the resource access is new.

func Not added in v0.16.0

func Not(condition Condition) Condition

Not is a condition that evaluates to true if its child condition evaluates to false. False otherwise.

func (Condition) Eval added in v0.15.0

func (c Condition) Eval(d ResourceData, key string) bool

Eval performs the evaluation of the condition.

type Iterator added in v0.1.8

type Iterator interface {
	Elem(func(d ResourceData))
	List() []interface{}
	Len() int
}

Iterator is used to iterate over a list or set.

Elem iterates over all elements of the iterator, calling fn with each iteration. The callback takes a Data interface as argument which is prefixed with its parents key, allowing for convenient nested data access.

List returns all elements of the iterator as a Go slice.

Len returns the number of elements held by the iterator.

func List added in v0.1.8

func List(d ResourceData, key string, conditions ...Condition) Iterator

List accesses the value held by key and returns an iterator able to go over its elements.

func Set added in v0.2.1

func Set(d ResourceData, key string, conditions ...Condition) Iterator

Set accesses the value held by key, type asserts it to a set and returns an iterator able to go over its elements.

type MapData added in v0.1.8

type MapData map[string]interface{}

MapData wraps a map satisfying the Data interface, so it can be used in the accessor methods defined below.

func (MapData) Get added in v0.15.0

func (md MapData) Get(key string) interface{}

func (MapData) GetChange added in v0.15.0

func (md MapData) GetChange(key string) (interface{}, interface{})

func (MapData) GetOk added in v0.15.0

func (md MapData) GetOk(key string) (interface{}, bool)

func (MapData) GetOkExists added in v0.1.9

func (md MapData) GetOkExists(key string) (interface{}, bool)

func (MapData) HasChange added in v0.1.9

func (md MapData) HasChange(key string) bool

func (MapData) IsNewResource added in v0.4.0

func (md MapData) IsNewResource() bool

func (MapData) Set added in v0.15.0

func (md MapData) Set(key string, value interface{}) error

type ResourceData added in v0.15.0

type ResourceData interface {

	// IsNewResource reports whether or not the resource is seen for the first
	// time. If so, checks for change won't be carried out.
	IsNewResource() bool

	// HasChange reports whether or not the given key has been changed.
	HasChange(key string) bool

	// GetChange returns the old and new value for a given key.
	GetChange(key string) (interface{}, interface{})

	// Get returns the data for the given key, or nil if the key doesn't exist
	// in the schema.
	Get(key string) interface{}

	// GetOk returns the data for the given key and whether or not the key
	// has been set to a non-zero value at some point.
	//
	// The first result will not necessarilly be nil if the value doesn't exist.
	// The second result should be checked to determine this information.
	GetOk(key string) (interface{}, bool)

	// GetOkExists can check if TypeBool attributes that are Optional with
	// no Default value have been set.
	//
	// Deprecated: usage is discouraged due to undefined behaviors and may be
	// removed in a future version of the SDK
	GetOkExists(key string) (interface{}, bool)

	// Set sets the value for the given key.
	//
	// If the key is invalid or the value is not a correct type, an error
	// will be returned.
	Set(key string, value interface{}) error
}

ResourceData generalises schema.ResourceData so that we can reuse the accessor methods defined below.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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