Help us shape the future of Go! Take the 2026 Go Developer Survey

cloning

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package cloning provides a cloning service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockClone

func NewMockClone() *models.Clone

NewMockClone instances a new Clone model.

Types

type CloneWrapper

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

CloneWrapper represents a cloning service wrapper.

func NewCloneWrapper

func NewCloneWrapper(clone *models.Clone) *CloneWrapper

NewCloneWrapper constructs a new CloneWrapper.

func (CloneWrapper) IsProtected

func (cw CloneWrapper) IsProtected() bool

IsProtected checks if clone is protected.

type Cloning

type Cloning interface {
	Run(ctx context.Context) error
	Reload(config Config)

	CreateClone(*types.CloneCreateRequest) (*models.Clone, error)
	DestroyClone(string) error
	GetClone(string) (*models.Clone, error)
	UpdateClone(string, *types.CloneUpdateRequest) (*models.Clone, error)
	UpdateCloneStatus(string, models.Status) error
	ResetClone(string) error

	GetInstanceState() (*models.InstanceStatus, error)
	GetSnapshots() ([]models.Snapshot, error)
	GetClones() []*models.Clone
}

Cloning defines a Cloning service interface.

func New

func New(cfg *Config, provision *provision.Provisioner) Cloning

New returns a cloning interface depends on configuration mode.

func NewBaseCloning

func NewBaseCloning(cfg *Config, provision *provision.Provisioner) Cloning

NewBaseCloning instances a new base Cloning.

func NewMockCloning

func NewMockCloning(cfg *Config) Cloning

NewMockCloning instances a new mock Cloning.

type Config

type Config struct {
	MaxIdleMinutes uint   `yaml:"maxIdleMinutes"`
	AccessHost     string `yaml:"accessHost"`
}

Config contains a cloning configuration.

Jump to

Keyboard shortcuts

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