web

package
v0.0.0-...-4c137d3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Templater = tmplutil.Preregister(&tmplutil.Templater{
	FileSystem: webFS,
	Includes: map[string]string{
		"css":    "components/css.html",
		"header": "components/header.html",
		"footer": "components/footer.html",
	},
	Functions: funcs,
})

Templater is the global template tree.

Functions

func MountStatic

func MountStatic() http.Handler

MountStatic mounts the /static folder.

Types

type Middleware

type Middleware = func(http.Handler) http.Handler

Middleware is the type for a middleware.

func InjectConfig

func InjectConfig(config RenderConfig) Middleware

InjectConfig injects the render config.

type RenderConfig

type RenderConfig struct {
	csufbot.Store
	config.Site

	Discord  *bot.Discord
	Services []config.Service
}

RenderConfig is the config to render with.

func GetRenderConfig

func GetRenderConfig(ctx context.Context) RenderConfig

GetRenderConfig gets the render config from the given context. It panics if the config is not available.

func (RenderConfig) FindService

func (rcfg RenderConfig) FindService(host string) *config.Service

FindService finds the LMS service from a given name hash.

func (RenderConfig) Service

func (rcfg RenderConfig) Service(host lms.Host) *config.Service

Service gets a service from the provided host. It returns nil if none is found.

Directories

Path Synopsis
components
admin
Package admin contains routes for guild owners to set up their guilds.
Package admin contains routes for guild owners to set up their guilds.
sync
Package sync contains routes for users to sync courses from LMS services into their account.
Package sync contains routes for users to sync courses from LMS services into their account.

Jump to

Keyboard shortcuts

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