registry

package
v0.0.0-...-511b1a1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveContainer

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

ActiveContainer represents a container currently running.

func (*ActiveContainer) Name

func (c *ActiveContainer) Name() string

Name returns the name of the container.

func (*ActiveContainer) SetActive

func (c *ActiveContainer) SetActive()

SetActive registers activity on the container.

type Registry

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

Registry stores and keeps track of the currently active cobtainers. Use the Get method on the registry to retrieve a stored container or add a new one.

func New

func New(d time.Duration, socketPath string) (*Registry, error)

New creates and returns a new registry for active containers. Containers are stopped after the provided duration. The LXD client is connected using the given socket path.

func (*Registry) Get

func (r *Registry) Get(name string) *ActiveContainer

Get returns the active container with the given name. The container is also stored in the registry if not already known.

Jump to

Keyboard shortcuts

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