Documentation ¶
Overview ¶
Package cloning provides a cloning service.
Index ¶
- type Base
- func (c *Base) ConnectToClone(ctx context.Context, cloneID string) (pgxtype.Querier, error)
- func (c *Base) CreateClone(cloneRequest *types.CloneCreateRequest) (*models.Clone, error)
- func (c *Base) DestroyClone(cloneID string) error
- func (c *Base) GetClone(id string) (*models.Clone, error)
- func (c *Base) GetClones() []*models.Clone
- func (c *Base) GetCloningState() models.Cloning
- func (c *Base) GetSnapshots() ([]models.Snapshot, error)
- func (c *Base) Reload(cfg Config)
- func (c *Base) ResetClone(cloneID string, resetOptions types.ResetCloneRequest) error
- func (c *Base) RestoreClonesState() error
- func (c *Base) Run(ctx context.Context) error
- func (c *Base) SaveClonesState()
- func (c *Base) UpdateClone(id string, patch types.CloneUpdateRequest) (*models.Clone, error)
- func (c *Base) UpdateCloneStatus(cloneID string, status models.Status) error
- type CloneWrapper
- type Config
- type SnapshotBox
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base provides cloning service.
func NewBase ¶
func NewBase(cfg *Config, provision *provision.Provisioner, tm *telemetry.Agent, observingCh chan string) *Base
NewBase instances a new Base service.
func (*Base) ConnectToClone ¶
ConnectToClone connects to clone by cloneID.
func (*Base) CreateClone ¶
CreateClone creates a new clone.
func (*Base) DestroyClone ¶
DestroyClone destroys clone.
func (*Base) GetCloningState ¶
GetCloningState returns the current state of instance.
func (*Base) GetSnapshots ¶
GetSnapshots returns all available snapshots.
func (*Base) ResetClone ¶
func (c *Base) ResetClone(cloneID string, resetOptions types.ResetCloneRequest) error
ResetClone resets clone to chosen snapshot.
func (*Base) RestoreClonesState ¶
RestoreClonesState restores clones data from disk.
func (*Base) SaveClonesState ¶
func (c *Base) SaveClonesState()
SaveClonesState writes clones state to disk.
func (*Base) UpdateClone ¶
UpdateClone updates clone.
type CloneWrapper ¶
type CloneWrapper struct { Clone *models.Clone `json:"clone"` Session *resources.Session `json:"session"` TimeCreatedAt time.Time `json:"time_created_at"` TimeStartedAt time.Time `json:"time_started_at"` }
CloneWrapper represents a cloning service wrapper.
func NewCloneWrapper ¶
func NewCloneWrapper(clone *models.Clone, createdAt time.Time) *CloneWrapper
NewCloneWrapper constructs a new CloneWrapper.
func (CloneWrapper) IsProtected ¶
func (cw CloneWrapper) IsProtected() bool
IsProtected checks if clone is protected.
type Config ¶
type Config struct { MaxIdleMinutes uint `yaml:"maxIdleMinutes"` AccessHost string `yaml:"accessHost"` }
Config contains a cloning configuration.
type SnapshotBox ¶
type SnapshotBox struct {
// contains filtered or unexported fields
}
SnapshotBox contains instance snapshots.