debug

package
v0.0.0-...-63b66d1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWorkspaceRoot

func GetWorkspaceRoot() string

func RunLocal

func RunLocal(commandline ...string) (err error)

func RunLocalCaptureOutput

func RunLocalCaptureOutput(commandline ...string) (out string, err error)

func RunOnMypi

func RunOnMypi(commandline ...string) (err error)

func RunOnMypiCaptureOutput

func RunOnMypiCaptureOutput(commandline ...string) (out string, err error)

func SetupProxy

func SetupProxy(r *gin.Engine, url string)

Types

type ActionInfo

type ActionInfo struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Selected bool   `json:"selected"`
	Disabled bool   `json:"disabled"`
}

type Component

type Component interface {
	MessageHost
	GetData() any
	GetInfo() ComponentInfo
	Name() string
	GetTTY() (buffered.BufferedTty, error)
	Start() error
	Stop() error
	Debug() error
	SetPort(port int) error
	SetDist(dist string)
	SetState(state string)
}

type ComponentInfo

type ComponentInfo struct {
	Service string       `json:"service"`
	Name    string       `json:"name"`
	Port    int          `json:"port"`
	Dist    string       `json:"dist,omitempty"`
	State   string       `json:"state"`
	Actions []ActionInfo `json:"actions"`
}

type MessageCallback

type MessageCallback func(topic string, value any)

type MessageHost

type MessageHost interface {
	Subscribe(topic string, callback MessageCallback)
}

type SSHConnector

type SSHConnector interface {
	io.Closer
	Run(ctx context.Context, uri string, port int, tty io.Writer) (result chan error, err error)
	SetLocalRouterPort(port int) (err error)
	GetFS() (fs.FS, error)
	GetHttpFS() (http.FileSystem, error)
}

type Service

type Service interface {
	MessageHost
	GetData() any
	Name() string
	AddComponent(comp Component)
	GetComponents() []Component
	GetComponent(name string) Component
}

type Services

type Services interface {
	MessageHost
	AddService(service Service)
	GetServices() []Service
	GetService(name string) Service
	GetComponent(svcName string, compName string) Component

	AddGenericService(name string)

	Run()
}

func NewServices

func NewServices(r *gin.Engine) Services

type WS

type WS struct {
	io.Closer
	// contains filtered or unexported fields
}

func NewWS

func NewWS() *WS

func (*WS) Publish

func (ws *WS) Publish(topic string, value any)

func (*WS) Run

func (ws *WS) Run(r *gin.RouterGroup)

Jump to

Keyboard shortcuts

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