backend

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry []*RegInfo

Registry of backends

Functions

func ConfigMap

func ConfigMap(bkInfo *RegInfo, configName string) *configmap.Map

ConfigMap creates a configmap.Map from the *RegInfo and the configName passed in. If bkInfo is nil then the returned configmap.Map should only be used for reading non backend specific parameters, such as global config

func Names

func Names() []string

Names backend names

func Register

func Register(info *RegInfo)

Register a backend

Types

type Backend

type Backend interface {
	Name() string
	Resize(size int64) error
	CurrentSize() (int64, error)
	Instances() (Instances, error)
	Terminate(instances Instances) error
}

type Instance

type Instance interface {
	Name() string
	Describe() error
	LaunchTime() *time.Time
}

type Instances

type Instances map[string]Instance

func NewInstances

func NewInstances() Instances

NewInstances create new map of instances

func (Instances) Add

func (i Instances) Add(instance Instance) Instances

Add adds an instance to Instances map

func (Instances) Itr added in v0.1.5

func (i Instances) Itr(fn func(Instance) bool) Instances

Iterate over the instances

func (Instances) Len added in v0.1.5

func (i Instances) Len() int64

Len of instances

type RegInfo

type RegInfo struct {
	Name       string
	NewBackend func(ctx context.Context, config configmap.Mapper) (Backend, error) `json:"-"`
	Options    fs.Options
}

func Find

func Find(name string) (*RegInfo, error)

Find looks for a RegInfo object for the name passed in.

func MustFind

func MustFind(name string) *RegInfo

MustFind looks for an Info object for the type name passed in

Directories

Path Synopsis
type
all
aws
gce

Jump to

Keyboard shortcuts

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