Documentation
¶
Overview ¶
Package applications is a generated GoMock package.
Index ¶
- Constants
- func EnsureDependenciesFromType(appType AppType) error
- func ImageProvidersFromSpec(spec *v1alpha1.RenderedDeviceSpec) ([]v1alpha1.ImageApplicationProvider, error)
- func NewApplication[T any](name string, provider T, appType AppType) *application[T]
- type AppType
- type Application
- type Container
- type ContainerStatusType
- type Controller
- type EmbeddedProvider
- type Manager
- type MockApplication
- func (m *MockApplication) AddContainer(container Container)
- func (m *MockApplication) Container(name string) (*Container, bool)
- func (m *MockApplication) EXPECT() *MockApplicationMockRecorder
- func (m *MockApplication) EnvVars() map[string]string
- func (m *MockApplication) IsEmbedded() bool
- func (m *MockApplication) Name() string
- func (m *MockApplication) Path() (string, error)
- func (m *MockApplication) RemoveContainer(name string) bool
- func (m *MockApplication) SetEnvVars(envVars map[string]string) bool
- func (m *MockApplication) Status() (*v1alpha1.DeviceApplicationStatus, v1alpha1.DeviceApplicationsSummaryStatus, ...)
- func (m *MockApplication) Type() AppType
- type MockApplicationMockRecorder
- func (mr *MockApplicationMockRecorder) AddContainer(container any) *gomock.Call
- func (mr *MockApplicationMockRecorder) Container(name any) *gomock.Call
- func (mr *MockApplicationMockRecorder) EnvVars() *gomock.Call
- func (mr *MockApplicationMockRecorder) IsEmbedded() *gomock.Call
- func (mr *MockApplicationMockRecorder) Name() *gomock.Call
- func (mr *MockApplicationMockRecorder) Path() *gomock.Call
- func (mr *MockApplicationMockRecorder) RemoveContainer(name any) *gomock.Call
- func (mr *MockApplicationMockRecorder) SetEnvVars(envVars any) *gomock.Call
- func (mr *MockApplicationMockRecorder) Status() *gomock.Call
- func (mr *MockApplicationMockRecorder) Type() *gomock.Call
- type MockManager
- func (m *MockManager) EXPECT() *MockManagerMockRecorder
- func (m *MockManager) Ensure(app Application) error
- func (m *MockManager) ExecuteActions(ctx context.Context) error
- func (m *MockManager) Remove(app Application) error
- func (m *MockManager) Status() ([]v1alpha1.DeviceApplicationStatus, v1alpha1.DeviceApplicationsSummaryStatus, ...)
- func (m *MockManager) Stop(ctx context.Context) error
- func (m *MockManager) Update(app Application) error
- type MockManagerMockRecorder
- func (mr *MockManagerMockRecorder) Ensure(app any) *gomock.Call
- func (mr *MockManagerMockRecorder) ExecuteActions(ctx any) *gomock.Call
- func (mr *MockManagerMockRecorder) Remove(app any) *gomock.Call
- func (mr *MockManagerMockRecorder) Status() *gomock.Call
- func (mr *MockManagerMockRecorder) Stop(ctx any) *gomock.Call
- func (mr *MockManagerMockRecorder) Update(app any) *gomock.Call
- type MockMonitor
- type MockMonitorMockRecorder
- type Monitor
- type PodmanContainerConfig
- type PodmanContainerState
- type PodmanEvent
- type PodmanInspect
- type PodmanMonitor
- func (m *PodmanMonitor) ExecuteActions(ctx context.Context) error
- func (m *PodmanMonitor) Initialize()
- func (m *PodmanMonitor) IsInitialized() bool
- func (m *PodmanMonitor) Run(ctx context.Context) error
- func (m *PodmanMonitor) Status() ([]v1alpha1.DeviceApplicationStatus, v1alpha1.DeviceApplicationsSummaryStatus, ...)
- func (m *PodmanMonitor) Stop(ctx context.Context) error
Constants ¶
const ( AppTypeLabel = "appType" DefaultImageManifestDir = "/" )
Variables ¶
This section is empty.
Functions ¶
func EnsureDependenciesFromType ¶
EnsureDependenciesFromType ensures that the dependencies required for the given app type are available.
func ImageProvidersFromSpec ¶
func ImageProvidersFromSpec(spec *v1alpha1.RenderedDeviceSpec) ([]v1alpha1.ImageApplicationProvider, error)
ImageProvidersFromSpec returns a list of image application providers from a rendered device spec.
func NewApplication ¶
Types ¶
type AppType ¶
type AppType string
const (
AppCompose AppType = "compose"
)
func ParseAppType ¶
func TypeFromImage ¶
TypeFromImage returns the app type from the image label.
func (AppType) ActionHandler ¶
func (a AppType) ActionHandler() (lifecycle.ActionHandlerType, error)
type Application ¶
type Application interface {
Name() string
Type() AppType
EnvVars() map[string]string
SetEnvVars(envVars map[string]string) bool
Path() (string, error)
Container(name string) (*Container, bool)
AddContainer(container Container)
RemoveContainer(name string) bool
IsEmbedded() bool
Status() (*v1alpha1.DeviceApplicationStatus, v1alpha1.DeviceApplicationsSummaryStatus, error)
}
type Container ¶
type Container struct {
ID string
Image string
Name string
Status ContainerStatusType
Restarts int
}
type ContainerStatusType ¶
type ContainerStatusType string
const ( ContainerStatusInit ContainerStatusType = "init" ContainerStatusRunning ContainerStatusType = "start" ContainerStatusDie ContainerStatusType = "die" // docker only ContainerStatusDied ContainerStatusType = "died" ContainerStatusRemove ContainerStatusType = "remove" ContainerStatusExited ContainerStatusType = "exited" )
func (ContainerStatusType) String ¶
func (c ContainerStatusType) String() string
func (ContainerStatusType) Vaild ¶
func (c ContainerStatusType) Vaild() bool
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController( podman *client.Podman, manager Manager, readWriter fileio.ReadWriter, log *log.PrefixLogger, ) *Controller
func (*Controller) Sync ¶
func (c *Controller) Sync(ctx context.Context, current, desired *v1alpha1.RenderedDeviceSpec) error
type EmbeddedProvider ¶
type EmbeddedProvider struct{}
EmbeddedProvider is a provider for embedded applications.
type Manager ¶
type Manager interface {
Ensure(app Application) error
Remove(app Application) error
Update(app Application) error
ExecuteActions(ctx context.Context) error
Status() ([]v1alpha1.DeviceApplicationStatus, v1alpha1.DeviceApplicationsSummaryStatus, error)
Stop(ctx context.Context) error
}
func NewManager ¶
type MockApplication ¶
type MockApplication struct {
// contains filtered or unexported fields
}
MockApplication is a mock of Application interface.
func NewMockApplication ¶
func NewMockApplication(ctrl *gomock.Controller) *MockApplication
NewMockApplication creates a new mock instance.
func (*MockApplication) AddContainer ¶
func (m *MockApplication) AddContainer(container Container)
AddContainer mocks base method.
func (*MockApplication) Container ¶
func (m *MockApplication) Container(name string) (*Container, bool)
Container mocks base method.
func (*MockApplication) EXPECT ¶
func (m *MockApplication) EXPECT() *MockApplicationMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockApplication) EnvVars ¶
func (m *MockApplication) EnvVars() map[string]string
EnvVars mocks base method.
func (*MockApplication) IsEmbedded ¶
func (m *MockApplication) IsEmbedded() bool
IsEmbedded mocks base method.
func (*MockApplication) Path ¶
func (m *MockApplication) Path() (string, error)
Path mocks base method.
func (*MockApplication) RemoveContainer ¶
func (m *MockApplication) RemoveContainer(name string) bool
RemoveContainer mocks base method.
func (*MockApplication) SetEnvVars ¶
func (m *MockApplication) SetEnvVars(envVars map[string]string) bool
SetEnvVars mocks base method.
func (*MockApplication) Status ¶
func (m *MockApplication) Status() (*v1alpha1.DeviceApplicationStatus, v1alpha1.DeviceApplicationsSummaryStatus, error)
Status mocks base method.
type MockApplicationMockRecorder ¶
type MockApplicationMockRecorder struct {
// contains filtered or unexported fields
}
MockApplicationMockRecorder is the mock recorder for MockApplication.
func (*MockApplicationMockRecorder) AddContainer ¶
func (mr *MockApplicationMockRecorder) AddContainer(container any) *gomock.Call
AddContainer indicates an expected call of AddContainer.
func (*MockApplicationMockRecorder) Container ¶
func (mr *MockApplicationMockRecorder) Container(name any) *gomock.Call
Container indicates an expected call of Container.
func (*MockApplicationMockRecorder) EnvVars ¶
func (mr *MockApplicationMockRecorder) EnvVars() *gomock.Call
EnvVars indicates an expected call of EnvVars.
func (*MockApplicationMockRecorder) IsEmbedded ¶
func (mr *MockApplicationMockRecorder) IsEmbedded() *gomock.Call
IsEmbedded indicates an expected call of IsEmbedded.
func (*MockApplicationMockRecorder) Name ¶
func (mr *MockApplicationMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name.
func (*MockApplicationMockRecorder) Path ¶
func (mr *MockApplicationMockRecorder) Path() *gomock.Call
Path indicates an expected call of Path.
func (*MockApplicationMockRecorder) RemoveContainer ¶
func (mr *MockApplicationMockRecorder) RemoveContainer(name any) *gomock.Call
RemoveContainer indicates an expected call of RemoveContainer.
func (*MockApplicationMockRecorder) SetEnvVars ¶
func (mr *MockApplicationMockRecorder) SetEnvVars(envVars any) *gomock.Call
SetEnvVars indicates an expected call of SetEnvVars.
func (*MockApplicationMockRecorder) Status ¶
func (mr *MockApplicationMockRecorder) Status() *gomock.Call
Status indicates an expected call of Status.
func (*MockApplicationMockRecorder) Type ¶
func (mr *MockApplicationMockRecorder) Type() *gomock.Call
Type indicates an expected call of Type.
type MockManager ¶
type MockManager struct {
// contains filtered or unexported fields
}
MockManager is a mock of Manager interface.
func NewMockManager ¶
func NewMockManager(ctrl *gomock.Controller) *MockManager
NewMockManager creates a new mock instance.
func (*MockManager) EXPECT ¶
func (m *MockManager) EXPECT() *MockManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockManager) Ensure ¶
func (m *MockManager) Ensure(app Application) error
Ensure mocks base method.
func (*MockManager) ExecuteActions ¶
func (m *MockManager) ExecuteActions(ctx context.Context) error
ExecuteActions mocks base method.
func (*MockManager) Remove ¶
func (m *MockManager) Remove(app Application) error
Remove mocks base method.
func (*MockManager) Status ¶
func (m *MockManager) Status() ([]v1alpha1.DeviceApplicationStatus, v1alpha1.DeviceApplicationsSummaryStatus, error)
Status mocks base method.
func (*MockManager) Stop ¶
func (m *MockManager) Stop(ctx context.Context) error
Stop mocks base method.
func (*MockManager) Update ¶
func (m *MockManager) Update(app Application) error
Update mocks base method.
type MockManagerMockRecorder ¶
type MockManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockManagerMockRecorder is the mock recorder for MockManager.
func (*MockManagerMockRecorder) Ensure ¶
func (mr *MockManagerMockRecorder) Ensure(app any) *gomock.Call
Ensure indicates an expected call of Ensure.
func (*MockManagerMockRecorder) ExecuteActions ¶
func (mr *MockManagerMockRecorder) ExecuteActions(ctx any) *gomock.Call
ExecuteActions indicates an expected call of ExecuteActions.
func (*MockManagerMockRecorder) Remove ¶
func (mr *MockManagerMockRecorder) Remove(app any) *gomock.Call
Remove indicates an expected call of Remove.
func (*MockManagerMockRecorder) Status ¶
func (mr *MockManagerMockRecorder) Status() *gomock.Call
Status indicates an expected call of Status.
type MockMonitor ¶
type MockMonitor struct {
// contains filtered or unexported fields
}
MockMonitor is a mock of Monitor interface.
func NewMockMonitor ¶
func NewMockMonitor(ctrl *gomock.Controller) *MockMonitor
NewMockMonitor creates a new mock instance.
func (*MockMonitor) EXPECT ¶
func (m *MockMonitor) EXPECT() *MockMonitorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMonitor) Status ¶
func (m *MockMonitor) Status() []v1alpha1.DeviceApplicationStatus
Status mocks base method.
type MockMonitorMockRecorder ¶
type MockMonitorMockRecorder struct {
// contains filtered or unexported fields
}
MockMonitorMockRecorder is the mock recorder for MockMonitor.
func (*MockMonitorMockRecorder) Run ¶
func (mr *MockMonitorMockRecorder) Run(ctx any) *gomock.Call
Run indicates an expected call of Run.
func (*MockMonitorMockRecorder) Status ¶
func (mr *MockMonitorMockRecorder) Status() *gomock.Call
Status indicates an expected call of Status.
type Monitor ¶
type Monitor interface {
Run(ctx context.Context)
Status() []v1alpha1.DeviceApplicationStatus
}
type PodmanContainerConfig ¶
type PodmanContainerState ¶
type PodmanContainerState struct {
OciVersion string `json:"OciVersion"`
Status string `json:"Status"`
Running bool `json:"Running"`
Paused bool `json:"Paused"`
Restarting bool `json:"Restarting"`
OOMKilled bool `json:"OOMKilled"`
Dead bool `json:"Dead"`
Pid int `json:"Pid"`
ExitCode int `json:"ExitCode"`
Error string `json:"Error"`
StartedAt string `json:"StartedAt"`
FinishedAt string `json:"FinishedAt"`
Healthcheck string `json:"Healthcheck"`
}
ContainerState represents the container state part of the podman inspect output
type PodmanEvent ¶
type PodmanInspect ¶
type PodmanInspect struct {
Restarts int `json:"RestartCount"`
State PodmanContainerState `json:"State"`
Config PodmanContainerConfig `json:"Config"`
}
PodmanInspect represents the overall structure of podman inspect output
type PodmanMonitor ¶
type PodmanMonitor struct {
// contains filtered or unexported fields
}
func NewPodmanMonitor ¶
func NewPodmanMonitor(log *log.PrefixLogger, exec executer.Executer, podman *client.Podman) *PodmanMonitor
func (*PodmanMonitor) ExecuteActions ¶
func (m *PodmanMonitor) ExecuteActions(ctx context.Context) error
func (*PodmanMonitor) Initialize ¶
func (m *PodmanMonitor) Initialize()
func (*PodmanMonitor) IsInitialized ¶
func (m *PodmanMonitor) IsInitialized() bool
func (*PodmanMonitor) Status ¶
func (m *PodmanMonitor) Status() ([]v1alpha1.DeviceApplicationStatus, v1alpha1.DeviceApplicationsSummaryStatus, error)