nomad

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 24 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(client api.Client, allocID string) tea.Cmd

func FetchAllocations

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

func FetchEventsStream added in v0.4.0

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

func FetchJobSpec

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

func FetchJobs

func FetchJobs(client api.Client) tea.Cmd

func FetchLogs

func FetchLogs(client api.Client, alloc api.Allocation, 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, logType LogType) 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 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 {
	Alloc    api.Allocation
	TaskName string
	Running  bool
}

func AllocationInfoFromKey added in v0.2.0

func AllocationInfoFromKey(key string) (AllocationInfo, error)

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 {
	CompleteValue string
	JQValue       string
	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 Page

type Page int8
const (
	Unset Page = iota
	JobsPage
	JobSpecPage
	JobEventsPage
	JobEventPage
	AllocEventsPage
	AllocEventPage
	AllEventsPage
	AllEventPage
	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 string, eventTopics Topics, 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  EventsStream
}

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