vpanels

package module
v0.0.0-...-958e258 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VPanelConfig

type VPanelConfig struct {
	Name   string             // Name of the panel
	Panels *kview.Panels      // Primary panel
	App    *kview.Application // Application or top level application
}

VPanelConfig is a struct that contains configuration information for a VPanel.

type VPanelFunc

type VPanelFunc func(cfg VPanelConfig) (*VPanelInfo, error)

VPanelFunc is a function type that represents a function that creates a new VPanelData instance. This function is used to define the behavior of each individual panel in the VPanels system.

The function takes a single parameter: - cfg (VPanelConfig): A struct containing configuration information for the panel.

The function returns two values: - *VPanelData: A pointer to a VPanelData instance representing the newly created panel. - error: An error value that will be nil if the panel creation is successful, or an error if it fails.

type VPanelInfo

type VPanelInfo struct {
	PanelName string                       // Name of the panel
	HelpID    string                       // Help ID for the panel
	TopFlex   *kview.Flex                  // Top Level Flex View
	TimerFn   func(step int, ticks uint64) // Timer callback function
}

type VPanels

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

VPanels is a primary structure that represents the VPanels system.

func GetVPanels

func GetVPanels() *VPanels

func Initialize

func Initialize(panels *kview.Panels, app *kview.Application) *VPanels

Initialize is a function that initializes the global VPanels instance. It uses a sync.Once to ensure that the initialization is performed only once, even if multiple goroutines call initVPanels concurrently.

func (*VPanels) Call

func (vp *VPanels) Call() error

func (*VPanels) Count

func (vp *VPanels) Count() int

func (*VPanels) GetInfo

func (vp *VPanels) GetInfo(idx int) *VPanelInfo

func (*VPanels) GetInfoList

func (vp *VPanels) GetInfoList() []*VPanelInfo

func (*VPanels) GetPanelNames

func (vp *VPanels) GetPanelNames() []string

func (*VPanels) IndexByName

func (vp *VPanels) IndexByName(name string) int

func (*VPanels) NameByIndex

func (vp *VPanels) NameByIndex(idx int) string

func (*VPanels) Register

func (vp *VPanels) Register(panelName string, panelIndex int, panelFunc VPanelFunc) error

Jump to

Keyboard shortcuts

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