util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindResource

type BindResource struct {
	ReadContext   func(ctx context.Context, left, right string, c *common.DatabricksClient) error
	CreateContext func(ctx context.Context, left, right string, c *common.DatabricksClient) error
	DeleteContext func(ctx context.Context, left, right string, c *common.DatabricksClient) error
}

BindResource defines resource with simplified functions

type CommonResource added in v0.3.0

type CommonResource struct {
	Create         func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error
	Read           func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error
	Update         func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error
	Delete         func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error
	StateUpgraders []schema.StateUpgrader
	Schema         map[string]*schema.Schema
	SchemaVersion  int
	Timeouts       *schema.ResourceTimeout
}

CommonResource aims to simplify things like error & deleted entities handling

func (CommonResource) ToResource added in v0.3.0

func (r CommonResource) ToResource() *schema.Resource

ToResource converts to Terraform resource definition

type Pair

type Pair struct {
	// contains filtered or unexported fields
}

Pair defines an ID pair

func NewPairID

func NewPairID(left, right string) *Pair

NewPairID creates new ID pair

func NewPairSeparatedID added in v0.3.0

func NewPairSeparatedID(left, right, separator string) *Pair

NewPairSeparatedID creates new ID pair with a custom separator

func (*Pair) BindResource

func (p *Pair) BindResource(pr BindResource) *schema.Resource

BindResource creates resource that relies on binding ID pair with simple schema & importer

func (*Pair) Pack

func (p *Pair) Pack(d *schema.ResourceData)

Pack data attributes to ID

func (*Pair) Schema

func (p *Pair) Schema(do func(map[string]*schema.Schema) map[string]*schema.Schema) *Pair

Schema sets custom schema

func (*Pair) Unpack

func (p *Pair) Unpack(d *schema.ResourceData) (string, string, error)

Unpack ID into two strings and set data

Jump to

Keyboard shortcuts

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