model

package
v0.0.0-...-35af3f0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database is the object contains the in-memory database.

func New

func New() (*Database, error)

New will create return the singleton Database instance.

func (*Database) DeleteContainer

func (in *Database) DeleteContainer(con *types.Container) error

DeleteContainer will delete provided container.

func (*Database) DeleteExec

func (in *Database) DeleteExec(exc *types.Exec) error

DeleteExec will delete provided exec.

func (*Database) DeleteImage

func (in *Database) DeleteImage(img *types.Image) error

DeleteImage will delete provided image.

func (*Database) DeleteNetwork

func (in *Database) DeleteNetwork(netw *types.Network) error

DeleteNetwork will delete provided network.

func (*Database) GetContainer

func (in *Database) GetContainer(id string) (*types.Container, error)

GetContainer will return a container with given id, or an error if the instance does not exist.

func (*Database) GetContainerByName

func (in *Database) GetContainerByName(name string) (*types.Container, error)

GetContainerByName will return a container with given name, or an error if the instance does not exist.

func (*Database) GetContainerByNameOrID

func (in *Database) GetContainerByNameOrID(id string) (*types.Container, error)

GetContainerByNameOrID will return a container with id/name, or an error if the instance does not exist.

func (*Database) GetContainers

func (in *Database) GetContainers() ([]*types.Container, error)

GetContainers will return all stored containers.

func (*Database) GetExec

func (in *Database) GetExec(id string) (*types.Exec, error)

GetExec will return a exec with given id, or an error if the instance does not exist.

func (*Database) GetExecs

func (in *Database) GetExecs() ([]*types.Exec, error)

GetExecs will return all stored execs.

func (*Database) GetImage

func (in *Database) GetImage(id string) (*types.Image, error)

GetImage will return an image with given id, or an error if the instance does not exist.

func (*Database) GetImageByName

func (in *Database) GetImageByName(name string) (*types.Image, error)

GetImageByName will return an image with given name, or an error if the instance does not exist.

func (*Database) GetImageByNameOrID

func (in *Database) GetImageByNameOrID(id string) (*types.Image, error)

GetImageByNameOrID will return an image with id/name, or an error if the instance does not exist.

func (*Database) GetImages

func (in *Database) GetImages() ([]*types.Image, error)

GetImages will return all stored execs.

func (*Database) GetNetwork

func (in *Database) GetNetwork(id string) (*types.Network, error)

GetNetwork will return a network with given id, or an error if the instance does not exist.

func (*Database) GetNetworkByName

func (in *Database) GetNetworkByName(name string) (*types.Network, error)

GetNetworkByName will return a network with given name, or an error if the instance does not exist.

func (*Database) GetNetworkByNameOrID

func (in *Database) GetNetworkByNameOrID(id string) (*types.Network, error)

GetNetworkByNameOrID will return a network with id/name, or an error if the instance does not exist.

func (*Database) GetNetworks

func (in *Database) GetNetworks() ([]*types.Network, error)

GetNetworks will return all stored networks.

func (*Database) GetNetworksByIDs

func (in *Database) GetNetworksByIDs(ids map[string]interface{}) ([]*types.Network, error)

GetNetworksByIDs will return all networks that are in the given set of network ids.

func (*Database) SaveContainer

func (in *Database) SaveContainer(con *types.Container) error

SaveContainer will either update the given container, or create a new record. If ID is not provided, it will generate an ID and adds the current time in Created.

func (*Database) SaveExec

func (in *Database) SaveExec(exc *types.Exec) error

SaveExec will either update the given exec, or create a new record. If ID is not provided, it will generate an ID and adds the current time in Created.

func (*Database) SaveImage

func (in *Database) SaveImage(img *types.Image) error

SaveImage will either update the given image, or create a new record. If ID is not provided, it will generate an ID and adds the current time in Created.

func (*Database) SaveNetwork

func (in *Database) SaveNetwork(netw *types.Network) error

SaveNetwork will either update the given network, or create a new record. If ID is not provided, it will generate an ID and adds the current time in Created.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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