nomad

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 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 FetchAllocSpec

func FetchAllocSpec(url, token, allocID string) tea.Cmd

func FetchAllocations

func FetchAllocations(url, token, jobID, jobNamespace string) tea.Cmd

func FetchEventsStream added in v0.4.0

func FetchEventsStream(url, token, topics, namespace string) tea.Cmd

func FetchJobSpec

func FetchJobSpec(url, token, jobID, jobNamespace string) tea.Cmd

func FetchJobs

func FetchJobs(url, token string) tea.Cmd

func FetchLogs

func FetchLogs(url, token, allocID, taskName string, logType LogType, logOffset int) 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) 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(r *bufio.Reader) tea.Cmd

func ReadExecWebSocketNextMessage added in v0.2.0

func ReadExecWebSocketNextMessage(ws *websocket.Conn) 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 AllocationInfo added in v0.2.0

type AllocationInfo struct {
	AllocID, TaskName string
	Running           bool
}

func AllocationInfoFromKey added in v0.2.0

func AllocationInfoFromKey(key string) (AllocationInfo, error)

type EventsStreamMsg added in v0.4.0

type EventsStreamMsg struct {
	Value  string
	Closed bool
}

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 Page

type Page int8
const (
	Unset Page = iota
	JobsPage
	JobSpecPage
	EventsPage
	EventPage
	AllocationsPage
	ExecPage
	AllocSpecPage
	LogsPage
	LoglinePage
)

func (Page) Backward

func (p Page) Backward() 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(jobID, taskName, allocID, eventTopics, eventNamespace string) string

func (Page) LoadingString

func (p Page) LoadingString() string

func (Page) String

func (p Page) String() string

type PageLoadedMsg

type PageLoadedMsg struct {
	Page        Page
	TableHeader []string
	AllPageRows []page.Row
	Connection  PersistentConnection
}

type PersistentConnection added in v0.4.0

type PersistentConnection struct {
	Reader *bufio.Reader
	Body   io.ReadCloser
}

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