Documentation ¶
Index ¶
- Variables
- func NewDockerSensor(ctx context.Context, deps resource.Dependencies, conf resource.Config, ...) (sensor.Sensor, error)
- func StringSliceEqual(a, b []string) bool
- func TestGetImageId(t *testing.T)
- func TestIsRunning(t *testing.T)
- type ComposeOptions
- type Config
- type Credentials
- type DockerConfig
- func (dc *DockerConfig) Close(ctx context.Context) error
- func (dc *DockerConfig) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)
- func (dc *DockerConfig) Ready(ctx context.Context, extra map[string]interface{}) (bool, error)
- func (dc *DockerConfig) Reconfigure(ctx context.Context, _ resource.Dependencies, conf resource.Config) error
- type DockerContainer
- type DockerContainerDetails
- type DockerImageDetails
- type DockerManager
- type LocalDockerContainer
- func (di *LocalDockerContainer) GetContainerId() string
- func (di *LocalDockerContainer) GetHasRun() (bool, error)
- func (di *LocalDockerContainer) GetImageId() (string, error)
- func (di *LocalDockerContainer) GetRepoDigest() string
- func (di *LocalDockerContainer) IsRunning() (bool, error)
- func (di *LocalDockerContainer) SetHasRun() error
- type LocalDockerManager
- func (dm *LocalDockerManager) CreateComposeContainers(imageName string, repoDigest string, composeFile []string, ...) ([]DockerContainer, error)
- func (dm *LocalDockerManager) CreateContainer(imageName string, repoDigest string, entry_point_args []string, ...) (DockerContainer, error)
- func (dm *LocalDockerManager) GetContainer(containerId string) (*DockerContainerDetails, error)
- func (dm *LocalDockerManager) GetContainerImageDigest(containerId string) (string, error)
- func (dm *LocalDockerManager) GetContainersRunningImage(repoDigest string) ([]DockerContainerDetails, error)
- func (dm *LocalDockerManager) GetImageDetails(imageId string) (*DockerImageDetails, error)
- func (dm *LocalDockerManager) ImageExists(repoDigest string) (bool, error)
- func (dm *LocalDockerManager) ListContainers() ([]DockerContainerDetails, error)
- func (dm *LocalDockerManager) ListImages() ([]DockerImageDetails, error)
- func (dm *LocalDockerManager) PullImage(imageName string, repoDigest string) error
- func (dm *LocalDockerManager) RemoveContainer(containerId string) error
- func (dm *LocalDockerManager) RemoveImageByImageId(imageId string) error
- func (dm *LocalDockerManager) RemoveImageByRepoDigest(repoDigest string) error
- func (dm *LocalDockerManager) StartContainer(containerId string) error
- func (dm *LocalDockerManager) StopContainer(containerId string) error
- type RunOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrComposeAndRunOptionsSet = errors.New("only one of run_options or compose_options can be set")
View Source
var ErrComposeFileRequired = errors.New("compose_file is required")
View Source
var ErrComposeRepoDigestRequired = errors.New("repo_digest is required in compose_file")
View Source
var ErrContainerNotFound = errors.New("container not found")
View Source
var ErrImageNameRequired = errors.New("image_name is required")
View Source
var ErrImageNotFound = errors.New("image not found")
View Source
var ErrPasswordIsRequired = errors.New("credentials.password is required")
View Source
var ErrRepoDigestRequired = errors.New("repo_digest is required")
View Source
var ErrUsernameIsRequired = errors.New("credentials.username is required")
View Source
var Model = resource.NewModel("viam-soleng", "manage", "docker")
Functions ¶
func NewDockerSensor ¶
func StringSliceEqual ¶
StringSliceEqual checks if two string slices are equal
func TestGetImageId ¶
func TestIsRunning ¶
Types ¶
type ComposeOptions ¶
type ComposeOptions struct {
ComposeFile []string `json:"compose_file"`
}
This is for docker compose based configs
type Config ¶
type Config struct { Attributes utils.AttributeMap `json:"attributes,omitempty"` RunOptions *RunOptions `json:"run_options"` ComposeOptions *ComposeOptions `json:"compose_options"` ImageName string `json:"image_name"` RepoDigest string `json:"repo_digest"` RunOnce bool `json:"run_once"` DownloadOnly bool `json:"download_only"` Credentials *Credentials `json:"credentials"` }
func (*Config) HasChanged ¶
type Credentials ¶
type DockerConfig ¶
func (*DockerConfig) Readings ¶
func (dc *DockerConfig) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)
Readings implements sensor.Sensor.
func (*DockerConfig) Reconfigure ¶
func (dc *DockerConfig) Reconfigure(ctx context.Context, _ resource.Dependencies, conf resource.Config) error
type DockerContainer ¶
type DockerContainer interface { IsRunning() (bool, error) GetHasRun() (bool, error) SetHasRun() error GetContainerId() string GetImageId() (string, error) GetRepoDigest() string }
func NewDockerContainer ¶
type DockerContainerDetails ¶
type DockerImageDetails ¶
type DockerManager ¶
type DockerManager interface { ListContainers() ([]DockerContainerDetails, error) CreateContainer(imageName string, repoDigest string, entry_point_args []string, options []string, logger logging.Logger, cancelCtx context.Context, cancelFunc context.CancelFunc) (DockerContainer, error) CreateComposeContainers(imageName string, repoDigest string, composeFile []string, logger logging.Logger, cancelCtx context.Context, cancelFunc context.CancelFunc) ([]DockerContainer, error) ListImages() ([]DockerImageDetails, error) GetImageDetails(imageId string) (*DockerImageDetails, error) GetContainer(containerId string) (*DockerContainerDetails, error) GetContainerImageDigest(containerId string) (string, error) GetContainersRunningImage(imageDigest string) ([]DockerContainerDetails, error) PullImage(imageName string, repoDigest string) error ImageExists(repoDigest string) (bool, error) RemoveImageByImageId(imageId string) error RemoveImageByRepoDigest(repoDigest string) error StartContainer(containerId string) error StopContainer(containerId string) error RemoveContainer(containerId string) error }
func NewLocalDockerManager ¶
func NewLocalDockerManager(logger logging.Logger) (DockerManager, error)
type LocalDockerContainer ¶
type LocalDockerContainer struct { Id string Name string RepoDigest string // contains filtered or unexported fields }
func (*LocalDockerContainer) GetContainerId ¶
func (di *LocalDockerContainer) GetContainerId() string
func (*LocalDockerContainer) GetHasRun ¶
func (di *LocalDockerContainer) GetHasRun() (bool, error)
func (*LocalDockerContainer) GetImageId ¶
func (di *LocalDockerContainer) GetImageId() (string, error)
func (*LocalDockerContainer) GetRepoDigest ¶
func (di *LocalDockerContainer) GetRepoDigest() string
func (*LocalDockerContainer) IsRunning ¶
func (di *LocalDockerContainer) IsRunning() (bool, error)
func (*LocalDockerContainer) SetHasRun ¶
func (di *LocalDockerContainer) SetHasRun() error
type LocalDockerManager ¶
type LocalDockerManager struct {
// contains filtered or unexported fields
}
func (*LocalDockerManager) CreateComposeContainers ¶
func (dm *LocalDockerManager) CreateComposeContainers(imageName string, repoDigest string, composeFile []string, logger logging.Logger, cancelCtx context.Context, cancelFunc context.CancelFunc) ([]DockerContainer, error)
func (*LocalDockerManager) CreateContainer ¶
func (dm *LocalDockerManager) CreateContainer(imageName string, repoDigest string, entry_point_args []string, options []string, logger logging.Logger, cancelCtx context.Context, cancelFunc context.CancelFunc) (DockerContainer, error)
func (*LocalDockerManager) GetContainer ¶
func (dm *LocalDockerManager) GetContainer(containerId string) (*DockerContainerDetails, error)
func (*LocalDockerManager) GetContainerImageDigest ¶
func (dm *LocalDockerManager) GetContainerImageDigest(containerId string) (string, error)
func (*LocalDockerManager) GetContainersRunningImage ¶
func (dm *LocalDockerManager) GetContainersRunningImage(repoDigest string) ([]DockerContainerDetails, error)
func (*LocalDockerManager) GetImageDetails ¶
func (dm *LocalDockerManager) GetImageDetails(imageId string) (*DockerImageDetails, error)
func (*LocalDockerManager) ImageExists ¶
func (dm *LocalDockerManager) ImageExists(repoDigest string) (bool, error)
func (*LocalDockerManager) ListContainers ¶
func (dm *LocalDockerManager) ListContainers() ([]DockerContainerDetails, error)
func (*LocalDockerManager) ListImages ¶
func (dm *LocalDockerManager) ListImages() ([]DockerImageDetails, error)
func (*LocalDockerManager) PullImage ¶
func (dm *LocalDockerManager) PullImage(imageName string, repoDigest string) error
func (*LocalDockerManager) RemoveContainer ¶
func (dm *LocalDockerManager) RemoveContainer(containerId string) error
func (*LocalDockerManager) RemoveImageByImageId ¶
func (dm *LocalDockerManager) RemoveImageByImageId(imageId string) error
func (*LocalDockerManager) RemoveImageByRepoDigest ¶
func (dm *LocalDockerManager) RemoveImageByRepoDigest(repoDigest string) error
func (*LocalDockerManager) StartContainer ¶
func (dm *LocalDockerManager) StartContainer(containerId string) error
func (*LocalDockerManager) StopContainer ¶
func (dm *LocalDockerManager) StopContainer(containerId string) error
type RunOptions ¶
Click to show internal directories.
Click to hide internal directories.