app

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context

	Flags Flags
	// contains filtered or unexported fields
}

Context handles communicating to the UI and processing flags.

func NewContext

func NewContext(sender func(msg tea.Msg)) (*Context, func())

NewContext creates a new Context with an attached sender method for communicating with the UI.

func (*Context) PublishError

func (ctx *Context) PublishError(msg string, args ...any)

PublishError sends an error Message to the UI.

func (*Context) PublishInfo

func (ctx *Context) PublishInfo(msg string, args ...any)

PublishInfo sends an info Message to the UI.

func (*Context) PublishService

func (ctx *Context) PublishService(kind, name string, port int)

PublishService sends a ServiceMessage to the UI. Registering the service with the UI.

func (*Context) PublishServiceError

func (ctx *Context) PublishServiceError(name string)

PublishServiceError sends a ServiceStatus to the UI indicating that the service is currently erroring.

func (*Context) PublishServiceOffline

func (ctx *Context) PublishServiceOffline(name string)

PublishServiceOffline sends a ServiceStatus to the UI indicating that the service is offline.

func (*Context) PublishServiceOnline

func (ctx *Context) PublishServiceOnline(name string)

PublishServiceOnline sends a ServiceStatus to the UI indicating that the service is online.

type Flags

type Flags struct {
	Services string
	Results  string
}

Flags contains flagged arguments to this program.

func (*Flags) Parse

func (f *Flags) Parse()

Parse handles loading flags passed to this program on startup.

type Message

type Message struct {
	Value string
	Kind  MessageKind
}

Message communicates log information.

func (Message) String

func (msg Message) String() string

type MessageKind

type MessageKind string
const (
	ErrorKind MessageKind = "error"
	InfoKind  MessageKind = "info"
)

type ServiceMessage

type ServiceMessage struct {
	Kind       string
	Name       string
	Port       int
	Status     string
	LastStatus time.Time
}

ServiceMessage communicates about a service.

type ServiceStatus

type ServiceStatus struct {
	Sent   time.Time
	Name   string
	Status string
}

ServiceStatus communicates about a service's status.

Jump to

Keyboard shortcuts

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