port

package
v0.0.0-...-5d951de Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CapAdapter

type CapAdapter interface {
	GetContainerCaps(ctx context.Context, id uuid.UUID) (types.Capabilities, error)
	CreateCap(ctx context.Context, c types.Capability) error
	DeleteContainerCaps(ctx context.Context, id uuid.UUID) error
}

type ContainerAdapter

type ContainerAdapter interface {
	GetContainer(ctx context.Context, id uuid.UUID) (*types.Container, error)
	GetContainers(ctx context.Context) (types.Containers, error)
	GetContainersWithFilters(ctx context.Context, filters types.ContainerFilters) (types.Containers, error)
	CreateContainer(ctx context.Context, container types.Container) error
	UpdateContainer(ctx context.Context, container types.Container) error
	DeleteContainer(ctx context.Context, id uuid.UUID) error
	GetContainerTags(ctx context.Context, id uuid.UUID) (types.Tags, error)
	AddTag(ctx context.Context, id uuid.UUID, tagID uuid.UUID) error
	DeleteTags(ctx context.Context, id uuid.UUID) error
	SetStatus(ctx context.Context, id uuid.UUID, status string) error
}

type ContainerHandler

type ContainerHandler interface {
	Get() gin.HandlerFunc
	GetContainers() gin.HandlerFunc
	CreateContainer() gin.HandlerFunc
	Delete() gin.HandlerFunc
	Patch() gin.HandlerFunc
	Start() gin.HandlerFunc
	Stop() gin.HandlerFunc
	AddContainerTag() gin.HandlerFunc
	GetDocker() gin.HandlerFunc
	RecreateDocker() gin.HandlerFunc
	ReloadContainer() gin.HandlerFunc
	GetLogs() gin.HandlerFunc
	GetVersions() gin.HandlerFunc
	WaitStatus() gin.HandlerFunc
	CheckForUpdates() gin.HandlerFunc
	ContainerEvents() gin.HandlerFunc
	ContainersEvents() gin.HandlerFunc
}

type ContainerService

type ContainerService interface {
	Get(ctx context.Context, id uuid.UUID) (*types.Container, error)
	GetContainers(ctx context.Context) (types.Containers, error)
	GetContainersWithFilters(ctx context.Context, filters types.ContainerFilters) (types.Containers, error)
	CreateContainer(ctx context.Context, opts types.CreateContainerOptions) (*types.Container, error)
	Delete(ctx context.Context, id uuid.UUID) error
	UpdateContainer(ctx context.Context, id uuid.UUID, c types.Container) error
	Start(ctx context.Context, id uuid.UUID) error
	StartAll(ctx context.Context) error
	Stop(ctx context.Context, id uuid.UUID) error
	StopAll(ctx context.Context) error
	AddContainerTag(ctx context.Context, id uuid.UUID, tagID uuid.UUID) error
	RecreateContainer(ctx context.Context, id uuid.UUID) error
	DeleteAll(ctx context.Context) error
	CheckForUpdates(ctx context.Context) (types.Containers, error)
	SetDatabases(ctx context.Context, c *types.Container, databases map[string]uuid.UUID, options map[string]*types.SetDatabasesOptions) error
	GetAllVersions(ctx context.Context, id uuid.UUID, useCache bool) ([]string, error)
	GetContainerInfo(ctx context.Context, id uuid.UUID) (map[string]any, error)
	WaitStatus(ctx context.Context, id uuid.UUID, status string) error
	GetLatestLogs(id uuid.UUID) ([]types.LogLine, error)
	GetTemplateByID(ctx context.Context, id string) (*types.Template, error)
	GetTemplates(ctx context.Context) []types.Template
	ReloadContainer(ctx context.Context, id uuid.UUID) error
}

type DockerAdapter

type DockerAdapter interface {
	ListContainers() ([]types.DockerContainer, error)
	DeleteContainer(id string) error
	CreateContainer(options types.CreateDockerContainerOptions) (types.CreateContainerResponse, error)
	StartContainer(id string) error
	StopContainer(id string) error
	InfoContainer(id string) (types.InfoContainerResponse, error)
	LogsStdoutContainer(id string) (io.ReadCloser, error)
	LogsStderrContainer(id string) (io.ReadCloser, error)
	WaitContainer(id string, cond types.WaitContainerCondition) error
	InfoImage(id string) (types.InfoImageResponse, error)
	PullImage(options types.PullImageOptions) (io.ReadCloser, error)
	BuildImage(options types.BuildImageOptions) (dockertypes.ImageBuildResponse, error)
	CreateVolume(options types.CreateVolumeOptions) (volume.Volume, error)
	DeleteVolume(name string) error
}

type DockerKernelHandler

type DockerKernelHandler interface {
	GetContainers() gin.HandlerFunc
	CreateContainer() gin.HandlerFunc
	DeleteContainer() gin.HandlerFunc
	StartContainer() gin.HandlerFunc
	StopContainer() gin.HandlerFunc
	InfoContainer() gin.HandlerFunc
	LogsStdoutContainer() gin.HandlerFunc
	LogsStderrContainer() gin.HandlerFunc
	WaitContainer() gin.HandlerFunc
	DeleteMounts() gin.HandlerFunc
	InfoImage() gin.HandlerFunc
	PullImage() gin.HandlerFunc
	BuildImage() gin.HandlerFunc
	CreateVolume() gin.HandlerFunc
	DeleteVolume() gin.HandlerFunc
}

type DockerService

type DockerService interface {
	ListContainers() ([]types.DockerContainer, error)
	DeleteContainer(id string) error
	CreateContainer(options types.CreateDockerContainerOptions) (types.CreateContainerResponse, error)
	StartContainer(id string) error
	StopContainer(id string) error
	InfoContainer(id string) (types.InfoContainerResponse, error)
	LogsStdoutContainer(id string) (io.ReadCloser, error)
	LogsStderrContainer(id string) (io.ReadCloser, error)
	WaitContainer(id string, cond types.WaitContainerCondition) error
	DeleteMounts(uuid string) error
	InfoImage(id string) (types.InfoImageResponse, error)
	PullImage(options types.PullImageOptions) (io.ReadCloser, error)
	BuildImage(options types.BuildImageOptions) (vtypes.ImageBuildResponse, error)
	CreateVolume(name string) (volume.Volume, error)
	DeleteVolume(name string) error
}

type EnvAdapter

type EnvAdapter interface {
	GetEnvs(ctx context.Context, filters types.EnvVariableFilters) ([]types.EnvVariable, error)
	CreateEnv(ctx context.Context, variable types.EnvVariable) error
	DeleteEnv(ctx context.Context, id uuid.UUID) error
	DeleteEnvs(ctx context.Context, id uuid.UUID) error
	UpdateEnvByID(ctx context.Context, variable types.EnvVariable) error
	UpdateEnvByName(ctx context.Context, variable types.EnvVariable) error
}

type EnvHandler

type EnvHandler interface {
	GetEnv() gin.HandlerFunc
	PatchEnv() gin.HandlerFunc
	DeleteEnv() gin.HandlerFunc
	CreateEnv() gin.HandlerFunc
}

type EnvService

type EnvService interface {
	GetEnvs(ctx context.Context, filters types.EnvVariableFilters) ([]types.EnvVariable, error)
	PatchEnv(ctx context.Context, env types.EnvVariable) error
	DeleteEnv(ctx context.Context, id uuid.UUID) error
	CreateEnv(ctx context.Context, env types.EnvVariable) error
}

type LogsAdapter

type LogsAdapter interface {
	Register(id uuid.UUID) error
	Unregister(id uuid.UUID) error
	UnregisterAll() error
	Push(id uuid.UUID, line types.LogLine)
	Pop(id uuid.UUID) (types.LogLine, error)
	LoadBuffer(id uuid.UUID) ([]types.LogLine, error) // LoadBuffer loads the latest logs kept in memory.
	Exists(id uuid.UUID) bool
}

type MetricsService

type MetricsService interface {
	metric.RegistryProvider
}

type MockContainerService

type MockContainerService struct{ mock.Mock }

func (*MockContainerService) AddContainerTag

func (m *MockContainerService) AddContainerTag(ctx context.Context, id uuid.UUID, tagID uuid.UUID) error

func (*MockContainerService) CheckForUpdates

func (m *MockContainerService) CheckForUpdates(ctx context.Context) (types.Containers, error)

func (*MockContainerService) CreateContainer

func (*MockContainerService) CreateEnv

func (m *MockContainerService) CreateEnv(ctx context.Context, env types.EnvVariable) error

func (*MockContainerService) Delete

func (m *MockContainerService) Delete(ctx context.Context, uuid uuid.UUID) error

func (*MockContainerService) DeleteAll

func (m *MockContainerService) DeleteAll(ctx context.Context) error

func (*MockContainerService) DeleteEnv

func (m *MockContainerService) DeleteEnv(ctx context.Context, id uuid.UUID) error

func (*MockContainerService) Get

func (*MockContainerService) GetAllVersions

func (m *MockContainerService) GetAllVersions(ctx context.Context, id uuid.UUID, useCache bool) ([]string, error)

func (*MockContainerService) GetContainerInfo

func (m *MockContainerService) GetContainerInfo(ctx context.Context, id uuid.UUID) (map[string]any, error)

func (*MockContainerService) GetContainers

func (m *MockContainerService) GetContainers(ctx context.Context) (types.Containers, error)

func (*MockContainerService) GetContainersWithFilters

func (m *MockContainerService) GetContainersWithFilters(ctx context.Context, filters types.ContainerFilters) (types.Containers, error)

func (*MockContainerService) GetEnvs

func (*MockContainerService) GetLatestLogs

func (m *MockContainerService) GetLatestLogs(id uuid.UUID) ([]types.LogLine, error)

func (*MockContainerService) GetPorts

func (m *MockContainerService) GetPorts(ctx context.Context, id uuid.UUID) (types.Ports, error)

func (*MockContainerService) GetTemplateByID

func (m *MockContainerService) GetTemplateByID(ctx context.Context, id string) (*types.Template, error)

func (*MockContainerService) GetTemplates

func (m *MockContainerService) GetTemplates(ctx context.Context) []types.Template

func (*MockContainerService) LoadAll

func (m *MockContainerService) LoadAll(ctx context.Context) error

func (*MockContainerService) PatchEnv

func (*MockContainerService) RecreateContainer

func (m *MockContainerService) RecreateContainer(ctx context.Context, uuid uuid.UUID) error

func (*MockContainerService) ReloadContainer

func (m *MockContainerService) ReloadContainer(ctx context.Context, id uuid.UUID) error

func (*MockContainerService) SetDatabases

func (m *MockContainerService) SetDatabases(ctx context.Context, inst *types.Container, databases map[string]uuid.UUID, options map[string]*types.SetDatabasesOptions) error

func (*MockContainerService) Start

func (m *MockContainerService) Start(ctx context.Context, uuid uuid.UUID) error

func (*MockContainerService) StartAll

func (m *MockContainerService) StartAll(ctx context.Context) error

func (*MockContainerService) Stop

func (m *MockContainerService) Stop(ctx context.Context, uuid uuid.UUID) error

func (*MockContainerService) StopAll

func (m *MockContainerService) StopAll(ctx context.Context) error

func (*MockContainerService) UpdateContainer

func (m *MockContainerService) UpdateContainer(ctx context.Context, uuid uuid.UUID, c types.Container) error

func (*MockContainerService) WaitStatus

func (m *MockContainerService) WaitStatus(ctx context.Context, id uuid.UUID, status string) error

type MockTagsService

type MockTagsService struct{ mock.Mock }

func (*MockTagsService) CreateTag

func (m *MockTagsService) CreateTag(ctx context.Context, tag types.Tag) (types.Tag, error)

func (*MockTagsService) DeleteTag

func (m *MockTagsService) DeleteTag(ctx context.Context, id uuid.UUID) error

func (*MockTagsService) GetTag

func (m *MockTagsService) GetTag(ctx context.Context, userID uuid.UUID, name string) (types.Tag, error)

func (*MockTagsService) GetTags

func (m *MockTagsService) GetTags(ctx context.Context, userID uuid.UUID) (types.Tags, error)

type PortAdapter

type PortAdapter interface {
	GetPorts(ctx context.Context, filters types.PortFilters) (types.Ports, error)
	CreatePort(ctx context.Context, port types.Port) error
	DeletePort(ctx context.Context, id uuid.UUID) error
	DeletePorts(ctx context.Context, id uuid.UUID) error
	UpdatePortByID(ctx context.Context, port types.Port) error
}

type PortsHandler

type PortsHandler interface {
	GetPorts() gin.HandlerFunc
	PatchPort() gin.HandlerFunc
	DeletePort() gin.HandlerFunc
	CreatePort() gin.HandlerFunc
}

type PortsService

type PortsService interface {
	GetPorts(ctx context.Context, filters types.PortFilters) (types.Ports, error)
	PatchPort(ctx context.Context, p types.Port) error
	DeletePort(ctx context.Context, id uuid.UUID) error
	CreatePort(ctx context.Context, p types.Port) error
}

type RunnerAdapter

type RunnerAdapter interface {
	GetDockerContainers(ctx context.Context) ([]types.DockerContainer, error)
	DeleteContainer(ctx context.Context, c *types.Container, volumes []string) error
	DeleteMounts(ctx context.Context, c *types.Container) error
	Start(ctx context.Context, c *types.Container, ports types.Ports, volumes types.Volumes, env []types.EnvVariable, caps types.Capabilities, sysctls types.Sysctls, setStatus func(status string)) (stdout io.ReadCloser, stderr io.ReadCloser, err error)
	Stop(ctx context.Context, c *types.Container) error
	Info(ctx context.Context, c types.Container) (map[string]any, error)
	WaitCondition(ctx context.Context, c *types.Container, cond types.WaitContainerCondition) error
	CheckForUpdates(ctx context.Context, c *types.Container) error
	HasUpdateAvailable(ctx context.Context, c types.Container) (bool, error)
	GetAllVersions(ctx context.Context, c types.Container) ([]string, error)
}

type SysctlAdapter

type SysctlAdapter interface {
	GetContainerSysctls(ctx context.Context, id uuid.UUID) (types.Sysctls, error)
	CreateSysctl(ctx context.Context, sysctl types.Sysctl) error
	DeleteContainerSysctls(ctx context.Context, id uuid.UUID) error
}

type TagAdapter

type TagAdapter interface {
	GetTag(ctx context.Context, userID uuid.UUID, name string) (types.Tag, error)
	GetTags(ctx context.Context, userID uuid.UUID) (types.Tags, error)
	CreateTag(ctx context.Context, tag types.Tag) error
	DeleteTag(ctx context.Context, id uuid.UUID) error
}

type TagsHandler

type TagsHandler interface {
	GetTag() gin.HandlerFunc
	GetTags() gin.HandlerFunc
	CreateTag() gin.HandlerFunc
	DeleteTag() gin.HandlerFunc
}

type TagsService

type TagsService interface {
	GetTag(ctx context.Context, userID uuid.UUID, name string) (types.Tag, error)
	GetTags(ctx context.Context, userID uuid.UUID) (types.Tags, error)
	CreateTag(ctx context.Context, tag types.Tag) (types.Tag, error)
	DeleteTag(ctx context.Context, id uuid.UUID) error
}

type TemplateAdapter

type TemplateAdapter interface {
	Get(id string) (types.Template, error)
	GetRaw(id string) (interface{}, error)
	GetAll() []types.Template
	Reload() error
}

type TemplateHandler

type TemplateHandler interface {
	GetTemplate() gin.HandlerFunc
	GetTemplates() gin.HandlerFunc
}

type VolumeAdapter

type VolumeAdapter interface {
	GetContainerVolumes(ctx context.Context, id uuid.UUID) (types.Volumes, error)
	CreateVolume(ctx context.Context, vol types.Volume) error
	DeleteContainerVolumes(ctx context.Context, id uuid.UUID) error
}

Jump to

Keyboard shortcuts

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