s_app

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoute

func NewRoute(dp RouteDataProvider) web.Route

NewRoute returns the page for this folder.

Types

type App

type App struct {
	State     string
	Since     string
	Stamp     string // since, as RFC 3339
	URL       string
	Problems  []Problem
	Command   string
	RunnerDir string
}

App is what the page shows of the app.

type DP

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

DP provides one app of the workspace, and starts, stops and switches it.

func NewDP

func NewDP(d *deps.Deps) *DP

NewDP returns the page's data provider.

func (*DP) Data

func (p *DP) Data(ctx context.Context, r *web.Request, _ web.ResponseWriter, data *RouteData) error

Data shows the app.

func (*DP) Guard

func (p *DP) Guard(ctx context.Context, r *web.Request) error

Guard answers 404 for a name that is not an app of the workspace, before a form or the live connection reaches the backend.

func (*DP) InitAuto

InitAuto needs nothing.

func (*DP) InitManual

InitManual needs nothing.

func (*DP) InitRestart

InitRestart needs nothing.

func (*DP) InitStart

InitStart needs nothing.

func (*DP) InitStop

InitStop needs nothing.

func (*DP) ProcessAuto

func (p *DP) ProcessAuto(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormAutoValues) error

ProcessAuto switches the app out of manual mode.

func (*DP) ProcessManual

func (p *DP) ProcessManual(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormManualValues) error

ProcessManual switches the app into manual mode.

func (*DP) ProcessRestart

func (p *DP) ProcessRestart(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormRestartValues) error

ProcessRestart restarts the app with Start, which restarts an app that runs and returns at once.

func (*DP) ProcessStart

func (p *DP) ProcessStart(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormStartValues) error

ProcessStart starts the app.

func (*DP) ProcessStop

func (p *DP) ProcessStop(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormStopValues) error

ProcessStop stops the app.

func (*DP) Subscribe

func (p *DP) Subscribe(ctx context.Context, r *web.Request, state *ReactiveState) error

Subscribe shows the app again at every change of the workspace.

type FormAutoValues

type FormAutoValues struct {
	form.BaseFormValues
}

FormAutoValues holds the fields of the form auto.

type FormManualValues

type FormManualValues struct {
	form.BaseFormValues
}

FormManualValues holds the fields of the form manual.

type FormRestartValues

type FormRestartValues struct {
	form.BaseFormValues
}

FormRestartValues holds the fields of the form restart.

type FormStartValues

type FormStartValues struct {
	form.BaseFormValues
}

FormStartValues holds the fields of the form start.

type FormStopValues

type FormStopValues struct {
	form.BaseFormValues
}

FormStopValues holds the fields of the form stop.

type Problem

type Problem = problem.Problem

Problem is why the app failed.

type ReactiveState

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

ReactiveState sends new values of the page's live variables to one open page. Its Set methods may be called from any goroutine.

func (*ReactiveState) SetApp

func (rs *ReactiveState) SetApp(v App)

SetApp stores v as app and sends the parts of the page that show it.

type RouteData

type RouteData struct {
	App  App
	Name string
}

RouteData holds the variables the template declares with <ssr:var>.

type RouteDataProvider

type RouteDataProvider interface {
	Guard(ctx context.Context, r *web.Request) error
	Data(ctx context.Context, r *web.Request, w web.ResponseWriter, data *RouteData) error
	InitAuto(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormAutoValues) error
	ProcessAuto(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormAutoValues) error
	InitManual(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormManualValues) error
	ProcessManual(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormManualValues) error
	InitRestart(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormRestartValues) error
	ProcessRestart(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormRestartValues) error
	InitStart(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormStartValues) error
	ProcessStart(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormStartValues) error
	InitStop(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormStopValues) error
	ProcessStop(ctx context.Context, r *web.Request, w web.ResponseWriter, data *FormStopValues) error
	// Subscribe runs while the page is open and must return when ctx is done.
	Subscribe(ctx context.Context, r *web.Request, state *ReactiveState) error
}

RouteDataProvider is what this page's DP implements.

Jump to

Keyboard shortcuts

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