Documentation ¶
Index ¶
- Constants
- Variables
- func BindAppKeys(app *App)
- func GetValue(c *Config, key string) string
- func SetConfigValues(c *Config, flags Flags)
- type Alert
- type Allocations
- func (a *Allocations) GetAllocationData(id string) (models.Allocations, bool)
- func (a *Allocations) HandleButtonResponse(index int, label string)
- func (a *Allocations) InitRestartModal()
- func (a *Allocations) OnBlur()
- func (a *Allocations) OnFocus()
- func (a *Allocations) OnRowSelected(row, col int)
- func (a *Allocations) Refresher()
- func (a *Allocations) Render(data map[string]string)
- func (a *Allocations) SetSelectedRow()
- func (a *Allocations) UpdateTable(data map[string]string)
- type App
- type Config
- func (c *Config) GetNamespace() string
- func (c *Config) GetRegion() string
- func (c *Config) IsRegionInConfig() bool
- func (c *Config) Load(flags Flags) (*Config, error)
- func (c *Config) SetNamespace(ns string)
- func (c *Config) SetRegion(region string)
- func (c *Config) UpdateConfigFile(key, newValue, oldValue string)
- type CustomModal
- type Flags
- type JobDefinition
- type Jobs
- func (j *Jobs) GoToDefinitions()
- func (j *Jobs) HandleStartModalResponse(index int, label string)
- func (j *Jobs) HandleStopModalResponse(index int, label string)
- func (j *Jobs) OnBlur()
- func (j *Jobs) OnFocus()
- func (j *Jobs) OnRowSelected(row, col int)
- func (j *Jobs) OnSelectionChanged(row, col int)
- func (j *Jobs) Refresher()
- func (j *Jobs) StartModal()
- func (j *Jobs) StopModal()
- func (j *Jobs) UpdateTable()
- type Layout
- type Log
- func (l *Log) BindInputCapture()
- func (l *Log) FetchLog()
- func (l *Log) FetchStdErrLog()
- func (l *Log) FetchStdOutLog()
- func (l *Log) OnBlur()
- func (l *Log) OnFocus()
- func (l *Log) SetFollow(follow bool)
- func (l *Log) SetLog(data []byte)
- func (l *Log) SetLogType(logType string)
- func (l *Log) SetPageSource(s string)
- func (l *Log) ShowFullScreen(fs bool)
- func (l *Log) StartLogStream(logChan <-chan *api.StreamFrame, errChan <-chan error)
- func (l *Log) StopLogStream()
- func (l *Log) UpdateMenu()
- type Main
- type Modal
- type Namespaces
- type Nodes
- type PrimitivesX
- type Regions
- type RunJob
- type Splash
- type TaskGroups
- type Tasks
- type VersionDiff
- type Versions
Constants ¶
View Source
const ( AppName = "ntui" ShortDesc = "A graphical CLI for your Hashicorp Nomad Cluster Management" LongDesc = "Ntui is a CLI to view and manage your Hashicorp Nomad Clusters." DefaultConfigDir = "." + AppName DefaultConfigFile = "config.toml" DefaultLogDir = "logs" DefaultLogFile = "/ntui.log" )
View Source
const ( LOG_STDOUT = "stdout" LOG_STDERR = "stderr" )
Variables ¶
View Source
var EnvVars = map[string]string{
"NOMAD_ADDR": "NomadBaseUrl",
"NOMAD_SKIP": "NomadSkipVerify",
"NOMAD_TOKEN": "NomadToken",
}
Functions ¶
func BindAppKeys ¶
func BindAppKeys(app *App)
func SetConfigValues ¶
Types ¶
type Allocations ¶
type Allocations struct { *views.Allocations App *App Listener *utils.Listener SelectedValue map[string]string TaskGroup map[string]string SelectedAlloc models.Allocations Data []models.Allocations }
func NewAllocations ¶
func NewAllocations(app *App) *Allocations
func (*Allocations) GetAllocationData ¶
func (a *Allocations) GetAllocationData(id string) (models.Allocations, bool)
func (*Allocations) HandleButtonResponse ¶
func (a *Allocations) HandleButtonResponse(index int, label string)
func (*Allocations) InitRestartModal ¶
func (a *Allocations) InitRestartModal()
func (*Allocations) OnBlur ¶
func (a *Allocations) OnBlur()
func (*Allocations) OnFocus ¶
func (a *Allocations) OnFocus()
func (*Allocations) OnRowSelected ¶
func (a *Allocations) OnRowSelected(row, col int)
func (*Allocations) Refresher ¶
func (a *Allocations) Refresher()
func (*Allocations) Render ¶
func (a *Allocations) Render(data map[string]string)
func (*Allocations) SetSelectedRow ¶
func (a *Allocations) SetSelectedRow()
func (*Allocations) UpdateTable ¶
func (a *Allocations) UpdateTable(data map[string]string)
type App ¶
type App struct { Config *Config Version string Layout *Layout NomadClient *nomad.Nomad Primitives PrimitivesX Alert *utils.Alert Logger *utils.Logger }
type Config ¶
type Config struct { AppName string `toml:"App_Name"` HomeDir string `toml:"Home_Dir"` LogLevel string `toml:"Log_Level"` LogDir string `toml:"Log_Dir"` RefreshRate int `toml:"Refresh_Rate"` NomadBaseUrl string `toml:"Nomad_Server_Base_Url"` NomadHttpAuth string `toml:"Nomad_Http_Auth"` NomadToken string `toml:"Nomad_Token"` Region string `toml:"Nomad_Region"` Namespace string `toml:"Nomad_Namespace"` NomadCaCert string `toml:"Nomad_Cacert"` NomadCaPath string `toml:"Nomad_Capath"` NomadClientCert string `toml:"Nomad_Client_Cert"` NomadClientKey string `toml:"Nomad_Client_Key"` NomadTlsServer string `toml:"Nomad_Tls_Server"` NomadSkipVerify bool `toml:"Nomad_Skip_Verify"` }
func (*Config) GetNamespace ¶
func (*Config) IsRegionInConfig ¶
func (*Config) SetNamespace ¶
func (*Config) UpdateConfigFile ¶
type CustomModal ¶
type CustomModal struct { *tview.Grid Modal1 *widgets.Modal1 App *App Title string Buttons []string Data string ResponseFn func(int, string) }
func NewCustomModal ¶
func NewCustomModal(app *App) *CustomModal
func (*CustomModal) GetPageTitle ¶
func (cm *CustomModal) GetPageTitle() string
func (*CustomModal) SetData ¶
func (cm *CustomModal) SetData(data string)
func (*CustomModal) SetInputHandler ¶
func (cm *CustomModal) SetInputHandler(handler func(event *tcell.EventKey) *tcell.EventKey)
func (*CustomModal) SetTitle ¶
func (cm *CustomModal) SetTitle(title string)
type Flags ¶
type JobDefinition ¶
type JobDefinition struct { *views.JobDefinition App *App Data map[string]string }
func NewJobDefinition ¶
func NewJobDefinition(app *App) *JobDefinition
func (*JobDefinition) OnBlur ¶
func (jd *JobDefinition) OnBlur()
func (*JobDefinition) OnFocus ¶
func (jd *JobDefinition) OnFocus()
func (*JobDefinition) UpdateTable ¶
func (jd *JobDefinition) UpdateTable()
type Jobs ¶
func (*Jobs) GoToDefinitions ¶
func (j *Jobs) GoToDefinitions()
func (*Jobs) HandleStartModalResponse ¶
func (*Jobs) HandleStopModalResponse ¶
func (*Jobs) OnRowSelected ¶
func (*Jobs) OnSelectionChanged ¶
func (*Jobs) StartModal ¶
func (j *Jobs) StartModal()
func (*Jobs) UpdateTable ¶
func (j *Jobs) UpdateTable()
type Layout ¶
type Layout struct { *views.App Pages *tview.Pages MainLayout *tview.Flex Splash *views.Splash Header *views.Header Body *widgets.Pages }
func (*Layout) ChangeFocusX ¶
func (*Layout) GetActivePage ¶
type Log ¶
type Log struct { *views.Log App *App SelectedAlloc models.Allocations DefaultType string Follow bool StopLogChan chan struct{} PageSource *string }
func (*Log) BindInputCapture ¶
func (l *Log) BindInputCapture()
func (*Log) FetchStdErrLog ¶
func (l *Log) FetchStdErrLog()
func (*Log) FetchStdOutLog ¶
func (l *Log) FetchStdOutLog()
func (*Log) SetLogType ¶
func (*Log) SetPageSource ¶
func (*Log) ShowFullScreen ¶
func (*Log) StartLogStream ¶
func (l *Log) StartLogStream(logChan <-chan *api.StreamFrame, errChan <-chan error)
func (*Log) StopLogStream ¶
func (l *Log) StopLogStream()
func (*Log) UpdateMenu ¶
func (l *Log) UpdateMenu()
type Modal ¶
type Modal struct { *widgets.Modal App *App Title string Buttons []string Data map[string]string ResponseFn func(int, string) }
func (*Modal) AddButtons ¶
func (*Modal) SetResponseFunc ¶
type Namespaces ¶
type Namespaces struct { *views.Namespaces App *App SelectedValue map[string]string }
func NewNamespaces ¶
func NewNamespaces(app *App) *Namespaces
func (*Namespaces) OnRowSelected ¶
func (n *Namespaces) OnRowSelected(row, col int)
func (*Namespaces) OnTabPress ¶
func (n *Namespaces) OnTabPress()
func (*Namespaces) UpdateTable ¶
func (n *Namespaces) UpdateTable()
type Nodes ¶
type Nodes struct { *views.Nodes App *App Listener *utils.Listener JobId string SelectedValue map[string]string }
func (*Nodes) UpdateTable ¶
func (n *Nodes) UpdateTable()
type PrimitivesX ¶
type PrimitivesX struct { Regions *Regions Namespaces *Namespaces Main *Main Jobs *Jobs TaskGroups *TaskGroups Allocations *Allocations Tasks *Tasks Log *Log Versions *Versions VersionDiff *VersionDiff Nodes *Nodes Modal *Modal CustomModal *CustomModal JobDefinition *JobDefinition RunJob *RunJob }
type Regions ¶
func NewRegions ¶
func (*Regions) OnRowSelected ¶
func (*Regions) OnTabPress ¶
func (reg *Regions) OnTabPress()
func (*Regions) UpdateTable ¶
func (reg *Regions) UpdateTable()
type TaskGroups ¶
type TaskGroups struct { *views.TaskGroups App *App Listener *utils.Listener JobId string SelectedValue map[string]string }
func NewTaskGroups ¶
func NewTaskGroups(app *App) *TaskGroups
func (*TaskGroups) OnBlur ¶
func (tg *TaskGroups) OnBlur()
func (*TaskGroups) OnFocus ¶
func (tg *TaskGroups) OnFocus()
func (*TaskGroups) OnRowSelected ¶
func (tg *TaskGroups) OnRowSelected(row, col int)
func (*TaskGroups) Refresher ¶
func (tg *TaskGroups) Refresher()
func (*TaskGroups) UpdateTable ¶
func (tg *TaskGroups) UpdateTable(jobId string)
type Tasks ¶
type Tasks struct { *views.Tasks App *App Listener *utils.Listener SelectedValue models.Allocations }
func (*Tasks) RefreshUsageStats ¶
func (t *Tasks) RefreshUsageStats()
type VersionDiff ¶
type VersionDiff struct { *views.VersionDiff App *App Listener *utils.Listener JobId string Data map[string]string }
func NewVersionDiff ¶
func NewVersionDiff(app *App) *VersionDiff
func (*VersionDiff) Render ¶
func (vd *VersionDiff) Render(jobId string, row map[string]string, diff models.JobVersionDiff)
type Versions ¶
type Versions struct { *views.Versions App *App Listener *utils.Listener JobId string SelectedValue map[string]string Diffs []models.JobVersionDiff }
func NewVersions ¶
func (*Versions) ConfirmModal ¶
func (v *Versions) ConfirmModal()
func (*Versions) HandleModalResponse ¶
func (*Versions) OnRowSelected ¶
func (*Versions) UpdateTable ¶
func (v *Versions) UpdateTable()
Click to show internal directories.
Click to hide internal directories.