Documentation
¶
Index ¶
- func NewRoute(dp RouteDataProvider) web.Route
- type App
- type DP
- func (p *DP) Data(ctx context.Context, r *web.Request, _ web.ResponseWriter, data *RouteData) error
- func (p *DP) Guard(ctx context.Context, r *web.Request) error
- func (p *DP) InitAuto(context.Context, *web.Request, web.ResponseWriter, *FormAutoValues) error
- func (p *DP) InitManual(context.Context, *web.Request, web.ResponseWriter, *FormManualValues) error
- func (p *DP) InitRestart(context.Context, *web.Request, web.ResponseWriter, *FormRestartValues) error
- func (p *DP) InitStart(context.Context, *web.Request, web.ResponseWriter, *FormStartValues) error
- func (p *DP) InitStop(context.Context, *web.Request, web.ResponseWriter, *FormStopValues) error
- func (p *DP) ProcessAuto(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormAutoValues) error
- func (p *DP) ProcessManual(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormManualValues) error
- func (p *DP) ProcessRestart(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormRestartValues) error
- func (p *DP) ProcessStart(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormStartValues) error
- func (p *DP) ProcessStop(_ context.Context, r *web.Request, _ web.ResponseWriter, _ *FormStopValues) error
- func (p *DP) Subscribe(ctx context.Context, r *web.Request, state *ReactiveState) error
- type FormAutoValues
- type FormManualValues
- type FormRestartValues
- type FormStartValues
- type FormStopValues
- type Problem
- type ReactiveState
- type RouteData
- type RouteDataProvider
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 (*DP) Guard ¶
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 ¶
func (p *DP) InitAuto(context.Context, *web.Request, web.ResponseWriter, *FormAutoValues) error
InitAuto needs nothing.
func (*DP) InitManual ¶
func (p *DP) InitManual(context.Context, *web.Request, web.ResponseWriter, *FormManualValues) error
InitManual needs nothing.
func (*DP) InitRestart ¶
func (p *DP) InitRestart(context.Context, *web.Request, web.ResponseWriter, *FormRestartValues) error
InitRestart needs nothing.
func (*DP) InitStart ¶
func (p *DP) InitStart(context.Context, *web.Request, web.ResponseWriter, *FormStartValues) error
InitStart needs nothing.
func (*DP) InitStop ¶
func (p *DP) InitStop(context.Context, *web.Request, web.ResponseWriter, *FormStopValues) error
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.
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 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 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.