nomad

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseWebSocket added in v0.2.0

func CloseWebSocket(ws *websocket.Conn) tea.Cmd

func FetchAllTasks added in v0.10.0

func FetchAllTasks(client api.Client, columns []string) tea.Cmd

func FetchAllocSpec

func FetchAllocSpec(client api.Client, allocID string) tea.Cmd

func FetchEventsStream added in v0.4.0

func FetchEventsStream(client api.Client, topics Topics, namespace string, page Page) tea.Cmd

func FetchJobMeta added in v0.10.0

func FetchJobMeta(client api.Client, jobID, jobNamespace string) tea.Cmd

func FetchJobSpec

func FetchJobSpec(client api.Client, jobID, jobNamespace string) tea.Cmd

func FetchJobs

func FetchJobs(client api.Client, columns []string) tea.Cmd

func FetchLogs

func FetchLogs(client api.Client, alloc api.Allocation, taskName string, logType LogType, logOffset int, logTail bool) tea.Cmd

func FetchTasksForJob added in v0.10.0

func FetchTasksForJob(client api.Client, jobID, jobNamespace string, columns []string) tea.Cmd

func GetAllPageConfigs added in v0.4.3

func GetAllPageConfigs(width, height int, copySavePath bool) map[Page]page.Config

func GetKeypress added in v0.2.0

func GetKeypress(msg tea.KeyMsg) (keypress string)

func GetPageKeyHelp

func GetPageKeyHelp(
	currentPage Page,
	filterFocused, filterApplied, saving, enteringInput, inPty, webSocketConnected bool,
	logType LogType,
	compact, inJobsMode bool,
) string

func InitiateWebSocket added in v0.2.0

func InitiateWebSocket(host, token, allocID, taskName, command string) tea.Cmd

func JobIDAndNamespaceFromKey

func JobIDAndNamespaceFromKey(key string) (string, string)

func LoadExecPage added in v0.4.0

func LoadExecPage() tea.Cmd

func PrettifyLine added in v0.4.0

func PrettifyLine(l string, p Page) tea.Cmd

func ReadEventsStreamNextMessage added in v0.4.0

func ReadEventsStreamNextMessage(c EventsStream, code *gojq.Code) tea.Cmd

func ReadExecWebSocketNextMessage added in v0.2.0

func ReadExecWebSocketNextMessage(ws *websocket.Conn) tea.Cmd

func ReadLogsStreamNextMessage added in v0.9.0

func ReadLogsStreamNextMessage(c LogsStream) tea.Cmd

func ResizeTty added in v0.2.0

func ResizeTty(ws *websocket.Conn, width, height int) tea.Cmd

func SendHeartbeat added in v0.2.0

func SendHeartbeat(ws *websocket.Conn) tea.Cmd

func SendHeartbeatWithDelay added in v0.2.0

func SendHeartbeatWithDelay() tea.Cmd

func SendWebSocketMessage added in v0.2.0

func SendWebSocketMessage(ws *websocket.Conn, keyPress string) tea.Cmd

func UpdatePageDataWithDelay added in v0.3.0

func UpdatePageDataWithDelay(id int, p Page, d time.Duration) tea.Cmd

Types

type Event added in v0.9.1

type Event struct {
	CompleteValue, JQValue string
}

type EventsStream added in v0.6.0

type EventsStream struct {
	Chan      <-chan *api.Events
	Topics    Topics
	Namespace string
}

type EventsStreamMsg added in v0.4.0

type EventsStreamMsg struct {
	Events []Event
	Topics Topics
}

type ExecWebSocketConnectedMsg added in v0.2.0

type ExecWebSocketConnectedMsg struct {
	WebSocketConnection *websocket.Conn
}

type ExecWebSocketHeartbeatMsg added in v0.2.0

type ExecWebSocketHeartbeatMsg struct{}

type ExecWebSocketResponseMsg added in v0.2.0

type ExecWebSocketResponseMsg struct {
	StdOut, StdErr string
	Close          bool
}

type LogType

type LogType int8
const (
	StdOut LogType = iota
	StdErr
)

func (LogType) ShortString

func (p LogType) ShortString() string

func (LogType) String

func (p LogType) String() string

type LogsStream added in v0.9.0

type LogsStream struct {
	Chan    <-chan *api.StreamFrame
	LogType LogType
}

type LogsStreamMsg added in v0.9.0

type LogsStreamMsg struct {
	Value string // may include line breaks
	Type  LogType
}

type Page

type Page int8
const (
	Unset Page = iota
	JobsPage
	AllTasksPage
	JobSpecPage
	JobEventsPage
	JobEventPage
	JobMetaPage
	AllocEventsPage
	AllocEventPage
	AllEventsPage
	AllEventPage
	JobTasksPage
	ExecPage
	AllocSpecPage
	LogsPage
	LoglinePage
)

func (Page) Backward

func (p Page) Backward(inJobsMode bool) Page

func (Page) DoesLoad added in v0.3.0

func (p Page) DoesLoad() bool

func (Page) DoesReload added in v0.3.0

func (p Page) DoesReload() bool

func (Page) Forward

func (p Page) Forward() Page

func (Page) GetFilterPrefix

func (p Page) GetFilterPrefix(namespace, jobID, taskName, allocName, allocID string, eventTopics Topics, eventNamespace string) string

func (Page) LoadingString

func (p Page) LoadingString() string

func (Page) ShowsTasks added in v0.10.0

func (p Page) ShowsTasks() bool

func (Page) String

func (p Page) String() string

type PageLoadedMsg

type PageLoadedMsg struct {
	Page         Page
	TableHeader  []string
	AllPageRows  []page.Row
	EventsStream EventsStream
	LogsStream   LogsStream
}

type TaskInfo added in v0.10.0

type TaskInfo struct {
	Alloc    api.Allocation
	TaskName string
	Running  bool
}

func TaskInfoFromKey added in v0.10.0

func TaskInfoFromKey(key string) (TaskInfo, error)

type Topics added in v0.6.0

type Topics map[api.Topic][]string

func TopicsForAlloc added in v0.7.0

func TopicsForAlloc(topics Topics, allocID string) Topics

func TopicsForJob added in v0.5.0

func TopicsForJob(topics Topics, job string) Topics

type UpdatePageDataMsg added in v0.3.0

type UpdatePageDataMsg struct {
	ID   int
	Page Page
}

Jump to

Keyboard shortcuts

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