config

package
v0.0.0-...-56f1d57 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinHeight   = 30
	MinWidth    = 110
	DialogWidth = 30
)
View Source
const (
	DefaultDarkTheme  = "tokyo_night"
	DefaultLightTheme = "tokyo_night_day"
)

Variables

This section is empty.

Functions

func NewConfigModel

func NewConfigModel(c *Config) *configModel

Create a new configuration UI model

The config UI is there to help guide users through the process of creating and managing the UI config.

Although the primary config is fairly basic, this helps guide users in its creation.

func NewMainModel

func NewMainModel(c *Config) *mainmodel

The primary configuration options tab

Types

type Config

type Config struct {
	Paths                    []string          `yaml:"paths"`
	CreateSessionKubeConfig  bool              `yaml:"createSessionKubeConfig"`
	DefaultSession           string            `yaml:"defaultSession"`
	ManageSessionKubeContext bool              `yaml:"manageSessionKubeContext"`
	Theme                    string            `yaml:"theme"`
	Sessions                 []helpers.Session `yaml:"sessions"`
	// contains filtered or unexported fields
}

func New

func New() (*Config, error)

Create a new config object

This will create a new Config object and load the config from disk If the configuration can't be found, a UI will be shown to help create the config. This is then stored at `~/.config/{appname}/config.yaml`

func (*Config) GetConfigFile

func (c *Config) GetConfigFile() string

Get the name of the config file being used

This returns a full path to the config file on disk

func (*Config) SetDefaultSession

func (c *Config) SetDefaultSession(name string) error

Set the default session

func (*Config) SetSessions

func (c *Config) SetSessions(sessions []helpers.Session) error

Save session information

Jump to

Keyboard shortcuts

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