ui

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package ui implements the UI service.

Index

Constants

View Source
const ServiceName = "ui"

ServiceName defines the name used for the UI service.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	UIPrefix        string                        // Path prefix to host the UI at.
	CallbackManager livedebugging.CallbackManager // CallbackManager is used for live debugging in the UI.
}

Options are used to configure the UI service. Options are constant for the lifetime of the UI service.

type Service

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

Service implements the UI service.

func New

func New(opts Options) *Service

New returns a new, unstarted UI service.

func (*Service) Data

func (s *Service) Data() any

Data implements service.Service. It returns nil, as the UI service does not have any runtime data.

func (*Service) Definition

func (s *Service) Definition() service.Definition

Definition returns the definition of the HTTP service.

func (*Service) Run

func (s *Service) Run(ctx context.Context, host service.Host) error

Run starts the UI service. It will run until the provided context is canceled or there is a fatal error.

func (*Service) ServiceHandler

func (s *Service) ServiceHandler(host service.Host) (base string, handler http.Handler)

ServiceHandler implements http_service.ServiceHandler. It returns the HTTP endpoints to host the UI.

func (*Service) Update

func (s *Service) Update(newConfig any) error

Update implements service.Service. It is a no-op since the UI service does not support runtime configuration.

Jump to

Keyboard shortcuts

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