handler

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserFromCtx

func UserFromCtx(ctx context.Context) (*domain.User, uuid.UUID)

Types

type AboutInstance

type AboutInstance struct {
	*CommonInstance
	Summary *domain.SystemSummary
}

type AdminInstance

type AdminInstance struct {
	*CommonInstance
	Page       int
	MaxPage    int
	TimeLayout string
}

func (*AdminInstance) NextPage

func (ins *AdminInstance) NextPage() int

func (*AdminInstance) PrevPage

func (ins *AdminInstance) PrevPage() int

type CommonInstance

type CommonInstance struct {
	Env             string
	Domain          string
	Session         string
	Error           error
	Message         *string
	User            *domain.User
	UserID          uuid.UUID
	ShowLoginModal  bool
	ShowLogoutModal bool
	CurrentView     string
	Version         string
	Dark            bool
	UI              *UITranslation
	// contains filtered or unexported fields
}

func (*CommonInstance) CloseAuthModals

func (c *CommonInstance) CloseAuthModals()

func (*CommonInstance) CloseError

func (c *CommonInstance) CloseError()

func (*CommonInstance) CloseMessage

func (c *CommonInstance) CloseMessage()

func (*CommonInstance) Locale

func (c *CommonInstance) Locale() string

func (*CommonInstance) OpenLoginModal

func (c *CommonInstance) OpenLoginModal()

func (*CommonInstance) OpenLogoutModal

func (c *CommonInstance) OpenLogoutModal()

func (*CommonInstance) SetLocale

func (c *CommonInstance) SetLocale(l string)

type Constants added in v1.0.4

type Constants struct {
	// to have constants in templates
	IntroStatus     string
	QuestionsStatus string
	FinishStatus    string
	ResultStatus    string
	MethodSten      string
	MethodPerc      string
	MethodMean      string
	MethodSum       string
}

type Handler

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

func NewHandler

func NewHandler(
	app *app.App,
	logger *logger.Logger,
	t string,
) *Handler

func (*Handler) About

func (h *Handler) About() live.Handler

func (*Handler) Admin

func (h *Handler) Admin() live.Handler

func (*Handler) BeginOAuth

func (h *Handler) BeginOAuth(res http.ResponseWriter, req *http.Request)

func (*Handler) CompleteOAuth

func (h *Handler) CompleteOAuth(res http.ResponseWriter, req *http.Request)

func (*Handler) HandleError added in v1.0.0

func (h *Handler) HandleError(ctx context.Context, err error)

func (*Handler) Home

func (h *Handler) Home() live.Handler

func (*Handler) Logout

func (h *Handler) Logout(res http.ResponseWriter, req *http.Request)

func (*Handler) Middleware

func (ah *Handler) Middleware(h http.Handler) http.Handler

func (*Handler) NewAboutInstance

func (h *Handler) NewAboutInstance(s live.Socket) *AboutInstance

func (*Handler) NewAdminInstance

func (h *Handler) NewAdminInstance(s live.Socket) *AdminInstance

func (*Handler) NewCommon

func (h *Handler) NewCommon(s live.Socket, currentView string) *CommonInstance

func (*Handler) NewConstants added in v1.0.4

func (h *Handler) NewConstants() *Constants

func (*Handler) NewHomeInstance

func (h *Handler) NewHomeInstance(s live.Socket) *HomeInstance

func (*Handler) NewNotFoundInstance

func (h *Handler) NewNotFoundInstance(s live.Socket) *NotFoundInstance

func (*Handler) NewPrivacyInstance

func (h *Handler) NewPrivacyInstance(s live.Socket) *PrivacyInstance

func (*Handler) NewProfileInstance

func (h *Handler) NewProfileInstance(s live.Socket) *ProfileInstance

func (*Handler) NewResultInstance

func (h *Handler) NewResultInstance(s live.Socket) *ResultInstance

func (*Handler) NewStatusInstance

func (h *Handler) NewStatusInstance(s live.Socket) *StatusInstance

func (*Handler) NewTermsInstance

func (h *Handler) NewTermsInstance(s live.Socket) *TermsInstance

func (*Handler) NewTestInstance

func (h *Handler) NewTestInstance(s live.Socket) *TestInstance

func (*Handler) NotFound

func (h *Handler) NotFound() live.Handler

func (*Handler) NotFoundRedirect

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

func (*Handler) Privacy

func (h *Handler) Privacy() live.Handler

func (*Handler) Profile

func (h *Handler) Profile() live.Handler

func (*Handler) Result

func (h *Handler) Result() live.Handler

func (*Handler) Status

func (h *Handler) Status() live.Handler

func (*Handler) Terms

func (h *Handler) Terms() live.Handler

func (*Handler) Test

func (h *Handler) Test() live.Handler

type HomeInstance

type HomeInstance struct {
	*CommonInstance
	Tests         []*domain.Test
	Summary       *domain.SystemSummary
	Tags          []*domain.Tag
	ActiveTags    []*domain.Tag
	FilterModeAny bool
}

type NotFoundInstance

type NotFoundInstance struct {
	*CommonInstance
}

type PrivacyInstance

type PrivacyInstance struct {
	*CommonInstance
}

type ProfileInstance

type ProfileInstance struct {
	*CommonInstance
	Summary    *domain.SystemSummary
	Page       int
	MaxPage    int
	TimeLayout string
}

func (*ProfileInstance) NextPage

func (ins *ProfileInstance) NextPage() int

func (*ProfileInstance) PrevPage

func (ins *ProfileInstance) PrevPage() int

type ResultInstance

type ResultInstance struct {
	*CommonInstance
	*Constants
	Test                 *domain.Test
	TestStep             string
	ShowDetails          bool
	ShowInstruction      bool
	ShowAdvancedSettings bool
	OverrideMethod       string
}

type StatusInstance

type StatusInstance struct {
	*CommonInstance
	Errors  []error
	Events  []domain.Event
	Version string
	Summary *domain.SystemSummary
}

type TermsInstance

type TermsInstance struct {
	*CommonInstance
}

type TestInstance

type TestInstance struct {
	*CommonInstance
	*Constants
	Test                 *domain.Test
	CurrentQuestions     []*domain.Question
	TestCode             string
	TestStep             string
	Page                 int
	AutoNext             bool
	ShowDetails          bool
	ShowInstruction      bool
	ShowAdvancedSettings bool
	OverrideMethod       string
}

type UITransBase

type UITransBase struct {
}

type UITransHome

type UITransHome struct {
	Title       string
	Description string
	TagThemes   string
	TagSize     string
	TagFeatures string
	TagAll      string
	TagAny      string
	TagFilter1  string
	TagFilter2  string
}

type UITransResult added in v1.0.4

type UITransResult struct {
	AdvancedSettings     string
	ResultsAreShown      string
	SetMethodDescription string
	Recalculate          string
	InStandartScale      string
	InPercentageScale    string
	InDefaultScale       string
	Discard              string
}

type UITransTest

type UITransTest struct {
	SelectLoc         string
	InterfaceSettings string
	Instructions      string
	About             string
	BeginLabel        string
	BeginButton       string
	ShowDetails       string
	HideDetails       string
	AutoNext          string
	AutoNextInfo      string
	ShowInstruction   string
	HideInstruction   string
	PrevButton        string
	NextButton        string
	FinishButton      string
	Page              string
	Of                string
	ResultLinkLabel   string
	ResultLinkInfo    string
	TakeThisButton    string
	ExploreButton     string
	DetailedReport    string
	Disclaimer        string
	NormsInfo         string
	TestMark          string
}

type UITranslation

type UITranslation struct {
	Base   *UITransBase
	Home   *UITransHome
	Test   *UITransTest
	Result *UITransResult
}

Jump to

Keyboard shortcuts

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