front

package
v1.9.0-defaulthomep.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(server *FrontServer, navItem *nav.Nav, innerFunc FrontHandlerFunc) http.HandlerFunc

Wrap wraps a known function in a HandlerFunc and passes along the server and item details it needs outside of the normal scope of the http request Ths resulting function is then passed to the mux handle func (or via middleware)

Types

type FrontHandlerFunc

type FrontHandlerFunc func(server *FrontServer, navItem *nav.Nav, w http.ResponseWriter, r *http.Request)

type FrontServer

type FrontServer struct {
	Ctx        context.Context
	Config     *config.Config
	Templates  []string
	ApiSchema  string
	ApiAddr    string
	Registered []string
}

func New

func New(ctx context.Context, conf *config.Config, templates []string) *FrontServer

func (*FrontServer) HasHomePage added in v1.8.2

func (fs *FrontServer) HasHomePage() (hasHome bool)

func (*FrontServer) Register added in v1.8.2

func (fs *FrontServer) Register(mux *http.ServeMux, navItem *nav.Nav, handler FrontHandlerFunc)

Register func deals with adding url handling on the mux and tracks urls

Directories

Path Synopsis
nav

Jump to

Keyboard shortcuts

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