models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	ID         int
	Repository string
	Name       string
	Tag        string

	Created time.Time
}

func (*Image) ParseString

func (i *Image) ParseString(image string)

func (*Image) String

func (i *Image) String() string

type ImageModel

type ImageModel struct {
	DB *sql.DB
}

func (*ImageModel) Get

func (m *ImageModel) Get(id int) (*Image, error)

func (*ImageModel) GetAll

func (m *ImageModel) GetAll() ([]*Image, error)

func (*ImageModel) Insert

func (m *ImageModel) Insert(repository string, name string, tag string) (int, error)

type ImageModelInterface

type ImageModelInterface interface {
	Insert(repository string, name string, tag string) (int, error)
	Get(id int) (*Image, error)
	GetAll() ([]*Image, error)
}

type Service

type Service struct {
	ID    int
	Name  string
	Hosts []string

	Status      ServiceStatus
	ContainerId *string
	ImageID     *int
	Network     *string
	Port        *string

	EnvironmentVariables *map[string]string

	Created time.Time
}

func (*Service) Url

func (s *Service) Url() string

type ServiceModel

type ServiceModel struct {
	DB *sql.DB
}

func (*ServiceModel) Delete

func (m *ServiceModel) Delete(id int) error

func (*ServiceModel) Get

func (m *ServiceModel) Get(id int) (*Service, error)

func (*ServiceModel) GetAll

func (m *ServiceModel) GetAll() ([]*Service, error)

func (*ServiceModel) GetByName

func (m *ServiceModel) GetByName(name string) (*Service, error)

func (*ServiceModel) Insert

func (m *ServiceModel) Insert(name string, hosts []string, image_id int, network string) (int, error)

func (*ServiceModel) UpdateContainerId

func (m *ServiceModel) UpdateContainerId(id int, containerId string) error

func (*ServiceModel) UpdateEnvironmentVariables added in v0.2.0

func (m *ServiceModel) UpdateEnvironmentVariables(id int, envVars map[string]string) error

func (*ServiceModel) UpdatePort

func (m *ServiceModel) UpdatePort(id int, port string) error

func (*ServiceModel) UpdateStatus

func (m *ServiceModel) UpdateStatus(id int, status ServiceStatus) error

type ServiceModelInterface

type ServiceModelInterface interface {
	Insert(name string, hosts []string, image int, network string) (int, error)
	Get(id int) (*Service, error)
	GetAll() ([]*Service, error)

	GetByName(name string) (*Service, error)

	UpdateStatus(id int, status ServiceStatus) error
	UpdateContainerId(id int, containerId string) error
	UpdatePort(id int, port string) error

	UpdateEnvironmentVariables(id int, envVars map[string]string) error

	Delete(id int) error
}

type ServiceStatus

type ServiceStatus string
const (
	PULLING ServiceStatus = "PULLING"
	CREATED ServiceStatus = "CREATED"
	RUNNING ServiceStatus = "RUNNING"
	STOPPED ServiceStatus = "STOPPED"
	ERROR   ServiceStatus = "ERROR"
)

Jump to

Keyboard shortcuts

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