crud

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2017 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const FiveMinutes time.Duration = 5 * time.Minute

Variables

This section is empty.

Functions

func CreateResource

func CreateResource(d *schema.ResourceData, sync ResourceCreator) (e error)

func DeleteResource

func DeleteResource(sync ResourceDeleter) (e error)

func ReadResource

func ReadResource(sync ResourceReader) (e error)

func UpdateResource

func UpdateResource(d *schema.ResourceData, sync ResourceUpdater) (e error)

Types

type BaseCrud

type BaseCrud struct {
	D      *schema.ResourceData
	Client client.BareMetalClient
}

func (*BaseCrud) VoidState

func (s *BaseCrud) VoidState()

type CustomTimeouter

type CustomTimeouter interface {
	CustomTimeout() time.Duration
}

type ExtraWaitPostDelete

type ExtraWaitPostDelete interface {
	ExtraWaitPostDelete() time.Duration
}

type IdentitySync

type IdentitySync struct{}

func (*IdentitySync) CreatedPending

func (s *IdentitySync) CreatedPending() []string

func (*IdentitySync) CreatedTarget

func (s *IdentitySync) CreatedTarget() []string

type ResourceCreator

type ResourceCreator interface {
	ResourceDataWriter
	ID() string
	Create() error
}

ResourceCreator creates a BareMetal resource based on ResourceData

type ResourceDataWriter

type ResourceDataWriter interface {
	ResourceVoider
	SetData()
}

ResourceDataWriter populates ResourceData based on current BareMetal Resource

type ResourceDeleter

type ResourceDeleter interface {
	ResourceVoider
	Delete() error
}

Deletes a BareMetal entity

type ResourceFetcher

type ResourceFetcher interface {
	Get() error
}

Gets the current BareMetal Resource

type ResourceReader

type ResourceReader interface {
	ResourceFetcher
	ResourceDataWriter
}

ResourceReader get BareMetal Resource and updated ResourceData

type ResourceUpdater

type ResourceUpdater interface {
	ResourceDataWriter
	Update() error
}

Updates a BareMetal entity to match ResourceData

type ResourceVoider

type ResourceVoider interface {
	VoidState() // Call this when the resource is gone
}

type StatefulResource

type StatefulResource interface {
	ResourceReader
	State() string
}

type StatefullyCreatedResource

type StatefullyCreatedResource interface {
	StatefulResource
	CreatedPending() []string
	CreatedTarget() []string
}

type StatefullyDeletedResource

type StatefullyDeletedResource interface {
	StatefulResource
	DeletedPending() []string
	DeletedTarget() []string
}

Jump to

Keyboard shortcuts

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