Documentation
¶
Index ¶
- type Context
- func (ctx *Context) PublishError(msg string, args ...any)
- func (ctx *Context) PublishInfo(msg string, args ...any)
- func (ctx *Context) PublishService(kind, name string, port int)
- func (ctx *Context) PublishServiceError(name string)
- func (ctx *Context) PublishServiceOffline(name string)
- func (ctx *Context) PublishServiceOnline(name string)
- type Flags
- type Message
- type MessageKind
- type ServiceMessage
- type ServiceStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context handles communicating to the UI and processing flags.
func NewContext ¶
NewContext creates a new Context with an attached sender method for communicating with the UI.
func (*Context) PublishError ¶
PublishError sends an error Message to the UI.
func (*Context) PublishInfo ¶
PublishInfo sends an info Message to the UI.
func (*Context) PublishService ¶
PublishService sends a ServiceMessage to the UI. Registering the service with the UI.
func (*Context) PublishServiceError ¶
PublishServiceError sends a ServiceStatus to the UI indicating that the service is currently erroring.
func (*Context) PublishServiceOffline ¶
PublishServiceOffline sends a ServiceStatus to the UI indicating that the service is offline.
func (*Context) PublishServiceOnline ¶
PublishServiceOnline sends a ServiceStatus to the UI indicating that the service is online.
type Message ¶
type Message struct {
Value string
Kind MessageKind
}
Message communicates log information.
type MessageKind ¶
type MessageKind string
const ( ErrorKind MessageKind = "error" InfoKind MessageKind = "info" )
type ServiceMessage ¶
ServiceMessage communicates about a service.