personas

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 6 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 DP

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

DP provides the personas and the apps whose persona can be chosen.

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, _ *web.Request, _ web.ResponseWriter, data *RouteData) error

Data lists the personas, and the persona page of every app with pages.

type Persona

type Persona struct {
	Name   string
	Roles  string
	Groups string
}

Persona is one persona, with its roles and groups joined into text.

type RouteData

type RouteData struct {
	Personas  []Persona
	Switchers []Switcher
}

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

type RouteDataProvider

type RouteDataProvider interface {
	Data(ctx context.Context, r *web.Request, w web.ResponseWriter, data *RouteData) error
}

RouteDataProvider is what this page's DP implements.

type Switcher

type Switcher struct {
	App string
	URL string
}

Switcher is the page of an app where the developer chooses the persona that app sees.

Jump to

Keyboard shortcuts

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