none

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomFail

func RandomFail(name string, probability uint8) error

Types

type Config

type Config struct {
	FailConfigApply    uint8 `json:"fail_config_apply"`    // Fail on config Apply (0 - not, 1-254 random, 255-yes)
	FailConfigValidate uint8 `json:"fail_config_validate"` // Fail on config Validation (0 - not, 1-254 random, 255-yes)
	FailStatus         uint8 `json:"fail_status"`          // Fail on Status (0 - not, 1-254 random, 255-yes)
	FailSnapshot       uint8 `json:"fail_snapshot"`        // Fail on Snapshot (0 - not, 1-254 random, 255-yes)
	FailDeallocate     uint8 `json:"fail_deallocate"`      // Fail on Deallocate (0 - not, 1-254 random, 255-yes)
	ResourcesLimit     int   `json:"resources_limit"`      // How many resources available in the driver (0 unlimited, -1 none)
}

func (*Config) Apply

func (c *Config) Apply(config []byte) error

func (*Config) Validate

func (c *Config) Validate() (err error)

type Definition

type Definition struct {
	FailDefinitionApply    uint8 `json:"fail_definition_apply"`    // Fail on definition Apply (0 - not, 1-254 random, 255-yes)
	FailDefinitionValidate uint8 `json:"fail_definition_validate"` // Fail on definition Validate (0 - not, 1-254 random, 255-yes)
	FailAllocate           uint8 `json:"fail_allocate"`            // Fail on Allocate (0 - not, 1-254 random, 255-yes)
}

func (*Definition) Apply

func (d *Definition) Apply(definition string) error

func (*Definition) Validate

func (d *Definition) Validate() error

type Driver

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

Implements drivers.ResourceDriver interface

func (*Driver) Allocate

func (d *Driver) Allocate(definition string, metadata map[string]interface{}) (string, string, error)

*

  • Pretend to Allocate (actually not) the Resource

func (*Driver) Deallocate

func (d *Driver) Deallocate(res_id string) error

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) Prepare

func (d *Driver) Prepare(config []byte) error

func (*Driver) Snapshot

func (d *Driver) Snapshot(res_id string, full bool) (string, error)

func (*Driver) Status

func (d *Driver) Status(res_id string) string

func (*Driver) ValidateDefinition

func (d *Driver) ValidateDefinition(definition string) error

Jump to

Keyboard shortcuts

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