adapter

package
v0.0.0-...-d84cd13 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainersHandler

func ContainersHandler(c *gofr.Context) (interface{}, error)

func ImagesHandler

func ImagesHandler(c *gofr.Context) (interface{}, error)

Types

type Adapter

type Adapter interface {
	RemoveImage(c *gofr.Context, imageId string) (interface{}, error)
	RunContainer(c *gofr.Context, imageName string, name string) (string, error)
	StopContainer(c *gofr.Context, containerId string) (bool, error)
	RemoveContainer(c *gofr.Context, containerId string) error
	ShowContainerLogs(c *gofr.Context, containerId string) (interface{}, error)
	ShowContainerStatus(c *gofr.Context, containerId string) (interface{}, error)
	StartContainer(c *gofr.Context, containerId string) (bool, error)
}

type DockerAdapter

type DockerAdapter struct{}

DockerAdapter provides an interface for interacting with Docker or Podman to manage containers and images.

func (*DockerAdapter) RemoveContainer

func (d *DockerAdapter) RemoveContainer(c *gofr.Context, containerId string) error

func (*DockerAdapter) RemoveImage

func (d *DockerAdapter) RemoveImage(c *gofr.Context, imageId string) (interface{}, error)

func (*DockerAdapter) RunContainer

func (d *DockerAdapter) RunContainer(c *gofr.Context, imageName string, name string) (string, error)

func (*DockerAdapter) ShowContainerLogs

func (d *DockerAdapter) ShowContainerLogs(c *gofr.Context, containerId string) (interface{}, error)

func (*DockerAdapter) ShowContainerStatus

func (d *DockerAdapter) ShowContainerStatus(c *gofr.Context, containerId string) (interface{}, error)

func (*DockerAdapter) StartContainer

func (d *DockerAdapter) StartContainer(c *gofr.Context, containerId string) (bool, error)

func (*DockerAdapter) StopContainer

func (d *DockerAdapter) StopContainer(c *gofr.Context, containerId string) (bool, error)

type PodmanAdapter

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

func NewPodmanAdapter

func NewPodmanAdapter() (*PodmanAdapter, error)

func (*PodmanAdapter) RemoveContainer

func (p *PodmanAdapter) RemoveContainer(c *gofr.Context, containerId string) error

func (*PodmanAdapter) RemoveImage

func (p *PodmanAdapter) RemoveImage(c *gofr.Context, imageId string) (interface{}, error)

func (*PodmanAdapter) RunContainer

func (p *PodmanAdapter) RunContainer(c *gofr.Context, imageName string, name string) (string, error)

func (*PodmanAdapter) ShowContainerLogs

func (p *PodmanAdapter) ShowContainerLogs(c *gofr.Context, containerId string) (interface{}, error)

func (*PodmanAdapter) ShowContainerStatus

func (p *PodmanAdapter) ShowContainerStatus(c *gofr.Context, containerId string) (interface{}, error)

func (*PodmanAdapter) StartContainer

func (p *PodmanAdapter) StartContainer(c *gofr.Context, containerId string) (bool, error)

func (*PodmanAdapter) StopContainer

func (p *PodmanAdapter) StopContainer(c *gofr.Context, containerId string) (bool, error)

Jump to

Keyboard shortcuts

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