runtime

package
v0.8.0-nightly.20240916 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Running = "running"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	NetworkSettings NetworkSettings `json:"NetworkSettings"`
	State           State           `json:"State"`
}

type DockerRuntime

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

func (*DockerRuntime) ContainerWithPort

func (p *DockerRuntime) ContainerWithPort(ctx context.Context, name, port string) (bool, error)

func (*DockerRuntime) GetContainerByName

func (p *DockerRuntime) GetContainerByName(ctx context.Context, name string) (*types.Container, error)

func (*DockerRuntime) IsUsingPort

func (p *DockerRuntime) IsUsingPort(container *types.Container, port uint16) bool

func (*DockerRuntime) Name

func (p *DockerRuntime) Name() string

type FinchRuntime

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

func (*FinchRuntime) ContainerWithPort

func (f *FinchRuntime) ContainerWithPort(ctx context.Context, name string, port string) (bool, error)

func (*FinchRuntime) Name

func (p *FinchRuntime) Name() string

type IRuntime

type IRuntime interface {
	// get runtime name
	Name() string

	// checks whether the container has the following
	ContainerWithPort(ctx context.Context, name, port string) (bool, error)
}

func DetectRuntime

func DetectRuntime() (rt IRuntime, err error)

func NewDockerRuntime

func NewDockerRuntime(name string) (IRuntime, error)

func NewFinchRuntime

func NewFinchRuntime() (IRuntime, error)

type NetworkSettings

type NetworkSettings struct {
	Ports map[string][]PortBinding `json:"Ports"`
}

type PortBinding

type PortBinding struct {
	HostIp   string `json:"HostIp"`
	HostPort string `json:"HostPort"`
}

type State

type State struct {
	Status string `json:"Status"`
}

Jump to

Keyboard shortcuts

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