provision

package
v2.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package provision provides an interface to provision Database Lab clones.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidConfig

func IsValidConfig(cfg Config) error

IsValidConfig defines a method for validation of a configuration.

func NewNoRoomError

func NewNoRoomError(errorMessage string) error

NewNoRoomError instances a new NoRoomError.

Types

type Config

type Config struct {
	PortPool          PortPool          `yaml:"portPool"`
	DockerImage       string            `yaml:"dockerImage"`
	UseSudo           bool              `yaml:"useSudo"`
	KeepUserPasswords bool              `yaml:"keepUserPasswords"`
	ContainerConfig   map[string]string `yaml:"containerConfig"`
}

Config defines configuration for provisioning.

type NoRoomError

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

NoRoomError defines a specific error type.

func (*NoRoomError) Error

func (e *NoRoomError) Error() string

type PortPool

type PortPool struct {
	From uint `yaml:"from"`
	To   uint `yaml:"to"`
}

PortPool describes an available port range for clones.

type Provisioner

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

Provisioner describes a struct for ports and clones management.

func New

func New(ctx context.Context, cfg *Config, dbCfg *resources.DB, docker *client.Client, pm *pool.Manager,
	networkID string) (*Provisioner, error)

New creates a new Provisioner instance.

func (*Provisioner) GetDiskState

func (p *Provisioner) GetDiskState() (*resources.Disk, error)

GetDiskState describes the state of the managed disk.

func (*Provisioner) GetSessionState

func (p *Provisioner) GetSessionState(s *resources.Session) (*resources.SessionState, error)

GetSessionState describes the state of the session.

func (*Provisioner) GetSnapshots

func (p *Provisioner) GetSnapshots() ([]resources.Snapshot, error)

GetSnapshots provides a snapshot list.

func (*Provisioner) Init

func (p *Provisioner) Init() error

Init inits provision.

func (*Provisioner) LastSessionActivity

func (p *Provisioner) LastSessionActivity(session *resources.Session, minimumTime time.Time) (*time.Time, error)

LastSessionActivity returns the time of the last session activity.

func (*Provisioner) Reload

func (p *Provisioner) Reload(cfg Config, dbCfg resources.DB)

Reload reloads provision configuration.

func (*Provisioner) ResetSession

func (p *Provisioner) ResetSession(session *resources.Session, snapshotID string) error

ResetSession resets an existing session.

func (*Provisioner) StartSession

func (p *Provisioner) StartSession(snapshotID string, user resources.EphemeralUser,
	extraConfig map[string]string) (*resources.Session, error)

StartSession starts a new session.

func (*Provisioner) StopSession

func (p *Provisioner) StopSession(session *resources.Session) error

StopSession stops an existing session.

Directories

Path Synopsis
databases
postgres
Package postgres provides an interface to work Postgres application.
Package postgres provides an interface to work Postgres application.
postgres/pgconfig
Package pgconfig provides tools for work with Postgres configuration.
Package pgconfig provides tools for work with Postgres configuration.
Package docker provides an interface to work with Docker containers.
Package docker provides an interface to work with Docker containers.
Package pool provides components to work with storage pools.
Package pool provides components to work with storage pools.
Package resources defines models used for provisioning.
Package resources defines models used for provisioning.
Package runners provides an interface to execute commands.
Package runners provides an interface to execute commands.
Package thinclones provides an interface to work different thin-clone managers.
Package thinclones provides an interface to work different thin-clone managers.
lvm
Package lvm provides an interface to work with LVM2.
Package lvm provides an interface to work with LVM2.
zfs
Package zfs provides an interface to work with ZFS.
Package zfs provides an interface to work with ZFS.

Jump to

Keyboard shortcuts

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