server

package
v1.10.0-sp2242.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrontServer

type FrontServer struct {
	Ctx        context.Context
	Config     *config.Config
	ApiSchema  string
	ApiAddr    string
	Mux        *http.ServeMux
	Templates  []string
	Registered []string
	PageData   map[string]interface{}
}

func New

func New(ctx context.Context, mux *http.ServeMux, cfg *config.Config, templates []string) (svr *FrontServer)

func (*FrontServer) HasHomepage

func (svr *FrontServer) HasHomepage() bool

func (*FrontServer) RedirectPage added in v1.9.2

func (svr *FrontServer) RedirectPage(origin string, destination string)

func (*FrontServer) Register

func (svr *FrontServer) Register()

func (*FrontServer) RegisterPage

func (svr *FrontServer) RegisterPage(uri string, navItem *nav.Nav)

type Page

type Page struct {
	Organisation string
	PageTitle    string

	NavigationTopbarItems  map[string]*nav.Nav
	ActiveSection          *nav.Nav
	NavigationSidebarItems []*nav.Nav
	CurrentPage            *nav.Nav

	Results map[string]interface{}
}

func NewPage

func NewPage(server *FrontServer, navItem *nav.Nav, request *http.Request) (pg *Page)

func (*Page) Get

func (pg *Page) Get(key string) interface{}

func (*Page) SetNavigation

func (pg *Page) SetNavigation(server *FrontServer, request *http.Request)

Jump to

Keyboard shortcuts

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