webapp

package
v0.0.0-...-a503075 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WebAppBase the start of the web apps URI
	WebAppBase = "/"

	// WebAppDashRoute the root URI for the web app dashboard
	WebAppDashRoute = WebAppBase + "dash"

	// WebAppDashCalendarRoute the URI for the web app's dash calendar page
	WebAppDashCalendarRoute = WebAppDashRoute + "/" + "calendar"

	// WebAppDashProfileRoute the URI for the web app's dash profile page
	WebAppDashProfileRoute = WebAppDashRoute + "/" + "profile"

	// WebAppDashBlankRoute the URI for the web app's dash blank page
	WebAppDashBlankRoute = WebAppDashRoute + "/" + "blank"

	// WebAppDashFormElementsRoute the URI for the web app's form elements page
	WebAppDashFormElementsRoute = WebAppDashRoute + "/" + "form-elements"

	// WebAppDashFormLayoutRoute the URI for the web app's form layout page
	WebAppDashFormLayoutRoute = WebAppDashRoute + "/" + "form-layout"

	// WebAppDashTablesRoute the URI for the web app's tables page
	WebAppDashTablesRoute = WebAppDashRoute + "/" + "tables"

	// WebAppDashSettingsRoute the URI for the web app's settings page
	WebAppDashSettingsRoute = WebAppDashRoute + "/" + "settings"

	// WebAppDashChartsRoute the URI for the web app's charts page
	WebAppDashChartsRoute = WebAppDashRoute + "/" + "charts"

	// WebAppDashAlertsRoute the URI for the web app's alerts page
	WebAppDashAlertsRoute = WebAppDashRoute + "/" + "alerts"

	// WebAppDashButtonsRoute the URI for the web app's buttons page
	WebAppDashButtonsRoute = WebAppDashRoute + "/" + "buttons"

	// WebAppPolicyTermsRoute the URI for the web app terms policy page
	WebAppPolicyTermsRoute = WebAppBase + "terms"

	// WebAppPolicyPrivacyRoute the URI for the web app privacy policy page
	WebAppPolicyPrivacyRoute = WebAppBase + "privacy-policy"

	// WebAppPolicyCookieRoute the URI for the web app cookie policy page
	WebAppPolicyCookieRoute = WebAppBase + "cookie-policy"

	// WebAppComingSoonRoute the URI for the web app coming soon page
	WebAppComingSoonRoute = WebAppBase + "coming-soon"

	// WebAppAuthRoute base URI prefix for the web app auth route for user authentication
	WebAppAuthRoute = WebAppBase + "auth/"

	// WebAppAuthLoginRoute the URI for the web app login page
	WebAppAuthLoginRoute = WebAppAuthRoute + "login"

	// WebAppAuthSignupRoute the URI for the web app signup page
	WebAppAuthSignupRoute = WebAppAuthRoute + "signup"

	// WebAppAuthResetPasswordRoute the URI for the web app reset password page
	WebAppAuthResetPasswordRoute = WebAppAuthRoute + "reset-password"

	// WebAppStaticRoute base URI prefix for the web app static route for assets
	WebAppStaticRoute = WebAppBase + "static/"
)

Variables

This section is empty.

Functions

func AttachRoutes

func AttachRoutes(request *AttachRoutesRequest)

AttachRoutes attaches webApp handler to corresponding routes on router

Types

type AttachRoutesRequest

type AttachRoutesRequest struct {
	// Router main router being served by server
	Router *router.Router

	// Handler valid web app handler
	Handler webAppHandler

	// WebAppFileSystem the file system that holds files utilised
	// by the web app
	WebAppFileSystem fs.FS

	// EmbeddedContentFilePathPrefix the prefix used to access the embedded files
	EmbeddedContentFilePathPrefix string
}

AttachRoutesRequest holds everything needed to attach web app routes to router

type Handler

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

Handler manages request for webapp

func NewWebAppHandler

func NewWebAppHandler(r *NewWebAppHandlerRequest) *Handler

NewWebAppHandler creates a new instance of a web app handler

func (*Handler) AuthLogin

func (h *Handler) AuthLogin(w http.ResponseWriter, r *http.Request)

func (*Handler) AuthResetPassword

func (h *Handler) AuthResetPassword(w http.ResponseWriter, r *http.Request)

func (*Handler) AuthSignup

func (h *Handler) AuthSignup(w http.ResponseWriter, r *http.Request)

func (*Handler) ComingSoon

func (h *Handler) ComingSoon(w http.ResponseWriter, r *http.Request)

func (*Handler) Cookie

func (h *Handler) Cookie(w http.ResponseWriter, r *http.Request)

func (*Handler) Dash

func (h *Handler) Dash(w http.ResponseWriter, r *http.Request)

func (*Handler) DashAlerts

func (h *Handler) DashAlerts(w http.ResponseWriter, r *http.Request)

func (*Handler) DashBlank

func (h *Handler) DashBlank(w http.ResponseWriter, r *http.Request)

func (*Handler) DashButtons

func (h *Handler) DashButtons(w http.ResponseWriter, r *http.Request)

func (*Handler) DashCalendar

func (h *Handler) DashCalendar(w http.ResponseWriter, r *http.Request)

func (*Handler) DashCharts

func (h *Handler) DashCharts(w http.ResponseWriter, r *http.Request)

func (*Handler) DashFormElements

func (h *Handler) DashFormElements(w http.ResponseWriter, r *http.Request)

func (*Handler) DashFormLayout

func (h *Handler) DashFormLayout(w http.ResponseWriter, r *http.Request)

func (*Handler) DashProfile

func (h *Handler) DashProfile(w http.ResponseWriter, r *http.Request)

func (*Handler) DashSettings

func (h *Handler) DashSettings(w http.ResponseWriter, r *http.Request)

func (*Handler) DashTables

func (h *Handler) DashTables(w http.ResponseWriter, r *http.Request)

func (*Handler) Home

func (h *Handler) Home(w http.ResponseWriter, r *http.Request)

func (*Handler) Privacy

func (h *Handler) Privacy(w http.ResponseWriter, r *http.Request)

func (*Handler) Terms

func (h *Handler) Terms(w http.ResponseWriter, r *http.Request)

type NewWebAppHandlerRequest

type NewWebAppHandlerRequest struct {
	EmbeddedContent fs.FS
	// EmbeddedContentFilePathPrefix the prefix used to access the embedded files
	EmbeddedContentFilePathPrefix string
	TermsOfServicePolicy          *policy.WebAppPolicy
	PrivacyPolicy                 *policy.WebAppPolicy
	CookiePolicy                  *policy.WebAppPolicy
}

NewWebAppHandlerRequest is the request needed to create a web app handler

Directories

Path Synopsis
policy

Jump to

Keyboard shortcuts

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