agent

package
v3.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentDataTable

func AgentDataTable(agent buildkite.Agent) string

func DefaultItemStyles

func DefaultItemStyles() (s itemStyles)

func MapStatusToColour

func MapStatusToColour(s string) lipgloss.Color

func NewDelegate

func NewDelegate() listAgentDelegate

func ParseMetadata

func ParseMetadata(metadataList []string) (string, string)

Types

type AgentItemsMsg

type AgentItemsMsg struct {
	// contains filtered or unexported fields
}

func NewAgentItemsMsg

func NewAgentItemsMsg(items []AgentListItem, page int) AgentItemsMsg

func (AgentItemsMsg) ListItems

func (a AgentItemsMsg) ListItems() []list.Item

type AgentListItem

type AgentListItem struct {
	buildkite.Agent
}

AgentListItem implements list.Item for displaying in a list

func (AgentListItem) FilterValue

func (ali AgentListItem) FilterValue() string

func (AgentListItem) QueueName

func (ali AgentListItem) QueueName() string

type AgentListModel

type AgentListModel struct {
	// contains filtered or unexported fields
}

func NewAgentList

func NewAgentList(loader func(int) tea.Cmd, page, perpage int) AgentListModel

func (AgentListModel) Init

func (m AgentListModel) Init() tea.Cmd

func (AgentListModel) Update

func (m AgentListModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (AgentListModel) View

func (m AgentListModel) View() string

type BulkAgent

type BulkAgent struct {
	Agents []StoppableAgent
}

BulkAgent aggregates multiple StoppableAgents to stop them in parallel and display the progress to the user.

func (BulkAgent) Init

func (bulkAgent BulkAgent) Init() tea.Cmd

Init implements tea.Model It calls all StoppableAgent Init methods

func (BulkAgent) Update

func (bulkAgent BulkAgent) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model. It handles cancelling the whole operation and passing through updates to each StoppableAgent to update the UI.

func (BulkAgent) View

func (bulkAgent BulkAgent) View() string

View implements tea.Model to aggregate the output of all StoppableAgents

type Status

type Status int
const (
	Waiting Status = iota
	Stopping
	Succeeded
	Failed
)

type StatusUpdate

type StatusUpdate struct {
	Cmd    tea.Cmd
	Err    error
	ID     string
	Status Status
}

StatusUpdate is used to update the internal state of a StoppableAgent

type StopFn

type StopFn func() StatusUpdate

StopFn represents a function that returns a StatusUpdate Use a function of this type to update the state of a StoppableAgent

type StoppableAgent

type StoppableAgent struct {
	// contains filtered or unexported fields
}

func NewStoppableAgent

func NewStoppableAgent(id string, stopFn StopFn) StoppableAgent

func (StoppableAgent) Errored

func (agent StoppableAgent) Errored() bool

func (StoppableAgent) Init

func (agent StoppableAgent) Init() tea.Cmd

Init implements tea.Model

func (StoppableAgent) Update

func (agent StoppableAgent) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (StoppableAgent) View

func (agent StoppableAgent) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

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