interfaces

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package interfaces provides manager interface definitions for WhaleTUI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerService

type ContainerService interface {
	ListContainers(ctx context.Context) ([]shared.Container, error)
	StartContainer(ctx context.Context, id string) error
	StopContainer(ctx context.Context, id string, timeout *time.Duration) error
	RestartContainer(ctx context.Context, id string, timeout *time.Duration) error
	RemoveContainer(ctx context.Context, id string, force bool) error
	InspectContainer(ctx context.Context, id string) (map[string]any, error)
	ExecContainer(ctx context.Context, id string, command []string, tty bool) (string, error)
}

ContainerService defines the interface for container operations

type DockerInfo

type DockerInfo interface {
	GetVersion() string
	GetOperatingSystem() string
	GetLoggingDriver() string
	GetConnectionMethod() string
}

DockerInfo represents Docker system information

type DockerInfoService

type DockerInfoService interface {
	GetDockerInfo(ctx context.Context) (*DockerInfo, error)
	GetActions() map[rune]string
	GetActionsString() string
}

DockerInfoService defines the interface for Docker info operations

type HeaderManagerInterface

type HeaderManagerInterface interface {
	CreateHeaderSection() tview.Primitive
	UpdateDockerInfo()
	UpdateNavigation()
	UpdateActions()
}

HeaderManagerInterface defines the interface for header management

type ImageService

type ImageService interface {
	ListImages(ctx context.Context) ([]shared.Image, error)
	RemoveImage(ctx context.Context, id string, force bool) error
	InspectImage(ctx context.Context, id string) (map[string]any, error)
	GetActions() map[rune]string
	GetActionsString() string
}

ImageService defines the interface for image operations

type LogsService

type LogsService interface {
	GetLogs(ctx context.Context, resourceType, resourceID string) (string, error)
	GetActions() map[rune]string
	GetActionsString() string
}

LogsService defines the interface for logs operations

type ModalManagerInterface

type ModalManagerInterface interface {
	ShowHelp()
	ShowError(error)
	ShowInfo(string)
	ShowConfirm(string, func(bool))
	ShowServiceScaleModal(string, uint64, func(int))
	ShowNodeAvailabilityModal(string, string, func(string))
	ShowContextualHelp(string, string)
	ShowRetryDialog(string, error, func() error, func())
	ShowFallbackDialog(string, error, []string, func(string))
}

ModalManagerInterface defines the interface for modal management

type NetworkService

type NetworkService interface {
	ListNetworks(ctx context.Context) ([]shared.Network, error)
	RemoveNetwork(ctx context.Context, id string) error
	InspectNetwork(ctx context.Context, id string) (map[string]any, error)
	GetActions() map[rune]string
	GetActionsString() string
}

NetworkService defines the interface for network operations

type ServiceFactoryInterface

type ServiceFactoryInterface interface {
	GetContainerService() ContainerService
	GetImageService() ImageService
	GetVolumeService() VolumeService
	GetNetworkService() NetworkService
	GetDockerInfoService() DockerInfoService
	GetLogsService() LogsService
	GetSwarmServiceService() any
	GetSwarmNodeService() any
	SetCurrentService(serviceName string)
	IsServiceAvailable(serviceName string) bool
	IsContainerServiceAvailable() bool
}

ServiceFactoryInterface defines the interface for service factory operations

type ServiceWithActions

type ServiceWithActions interface {
	GetActions() map[rune]string
	GetActionsString() string
}

ServiceWithActions defines the minimal interface for services that provide actions

type ServiceWithNavigation

type ServiceWithNavigation interface {
	GetNavigation() map[rune]string
	GetNavigationString() string
}

ServiceWithNavigation defines the minimal interface for services that provide navigation

type UIInterface

type UIInterface interface {
	// Services
	GetServices() ServiceFactoryInterface

	// UI methods
	ShowError(error)
	ShowInfo(string)
	ShowDetails(any)
	ShowCurrentView()
	ShowConfirm(string, func(bool))
	ShowServiceScaleModal(string, uint64, func(int))
	ShowNodeAvailabilityModal(string, string, func(string))
	ShowContextualHelp(string, string)
	ShowRetryDialog(string, error, func() error, func())
	ShowFallbackDialog(string, error, []string, func(string))

	// App methods
	GetApp() any

	// State methods
	IsInLogsMode() bool
	IsInDetailsMode() bool
	IsModalActive() bool
	GetCurrentActions() map[rune]string
	GetCurrentViewActions() string
	GetCurrentViewNavigation() string
	GetViewRegistry() any

	// Additional methods needed by managers
	GetMainFlex() any
	SwitchView(string)
	ShowHelp()

	// Additional methods needed by handlers
	GetPages() any
	ShowLogs(string, string)
	ShowShell(string, string)

	// Additional methods needed by modal manager
	GetViewContainer() any

	// Additional methods needed by views
	GetContainerService() ContainerService
	GetServicesAny() any
	GetSwarmServiceService() any
	GetSwarmNodeService() any

	// Theme management
	GetThemeManager() *config.ThemeManager
	ReloadTheme() error

	// Shutdown management
	GetShutdownChan() chan struct{}

	// Search functionality
	GetCurrentView() any
}

UIInterface defines the interface that views need from the UI

type VolumeService

type VolumeService interface {
	ListVolumes(ctx context.Context) ([]shared.Volume, error)
	RemoveVolume(ctx context.Context, id string, force bool) error
	InspectVolume(ctx context.Context, id string) (map[string]any, error)
	GetActions() map[rune]string
	GetActionsString() string
}

VolumeService defines the interface for volume operations

Jump to

Keyboard shortcuts

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