handler

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 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.SystemSymmary
	TrueChallengeExample    *domain.Challenge
	FalseChallengeExample   *domain.Challenge
	OngoingChallengeExample *domain.Challenge
}

type AdminInstance

type AdminInstance struct {
	*CommonInstance
	Challenges          []*domain.Challenge
	ChallengeCount      int
	FilterArgs          domain.FilterChallengesArgs
	CreateArgs          domain.CreateChallengeArgs
	Page                int
	MaxPage             int
	CreateChallengeForm bool
	CreatedChallenge    *domain.Challenge
	FormError           error
	TimeLayout          string
}

func (*AdminInstance) NextPage

func (ins *AdminInstance) NextPage() int

func (*AdminInstance) PrevPage

func (ins *AdminInstance) PrevPage() int

type ChallengeDetailsInstance

type ChallengeDetailsInstance struct {
	*CommonInstance
	Challenge       *domain.Challenge
	ShowModal       bool
	ModalPrediction bool
	ShowProofs      bool
}

type ChallengeListInstance

type ChallengeListInstance struct {
	*CommonInstance
	Challenges     []*domain.Challenge
	ChallengeCount int
	FilterArgs     domain.FilterChallengesArgs
	Page           int
	MaxPage        int
}

func (*ChallengeListInstance) NextPage

func (ins *ChallengeListInstance) NextPage() int

func (*ChallengeListInstance) PrevPage

func (ins *ChallengeListInstance) PrevPage() int

type ChallengeUpdateInstance

type ChallengeUpdateInstance struct {
	*CommonInstance
	Challenge     *domain.Challenge
	ChallengeArgs domain.CreateChallengeArgs
	FormPrefill   domain.CreateChallengeArgs
	FormError     error
	OutcomeError  error
	TimeLayout    string
}

type CommonInstance

type CommonInstance struct {
	Env             string
	Session         string
	Error           error
	Message         *string
	User            *domain.User
	UserID          uuid.UUID
	ShowLoginModal  bool
	ShowLogoutModal bool
	CurrentView     string
	Version         string
}

func (*CommonInstance) CloseAuthModals

func (c *CommonInstance) CloseAuthModals()

func (*CommonInstance) CloseError

func (c *CommonInstance) CloseError()

func (*CommonInstance) CloseMessage

func (c *CommonInstance) CloseMessage()

func (*CommonInstance) OpenLoginModal

func (c *CommonInstance) OpenLoginModal()

func (*CommonInstance) OpenLogoutModal

func (c *CommonInstance) OpenLogoutModal()

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) ChallengeDetails

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

func (*Handler) ChallengeList

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

func (*Handler) ChallengeUpdate

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

func (*Handler) CompleteOAuth

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

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) NewChallengeDetailsInstance

func (h *Handler) NewChallengeDetailsInstance(s live.Socket) *ChallengeDetailsInstance

func (*Handler) NewChallengeListInstance

func (h *Handler) NewChallengeListInstance(s live.Socket) *ChallengeListInstance

func (*Handler) NewChallengeUpdateInstance

func (h *Handler) NewChallengeUpdateInstance(s live.Socket) *ChallengeUpdateInstance

func (*Handler) NewCommon

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

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 added in v0.0.9

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

func (*Handler) NewProfileInstance

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

func (*Handler) NewTermsInstance added in v0.0.9

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

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 added in v0.0.9

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

func (*Handler) Profile

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

func (*Handler) Terms added in v0.0.9

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

type HomeInstance

type HomeInstance struct {
	*CommonInstance
	Summary                       *domain.SystemSymmary
	RandomFinishedChallenges      []*domain.Challenge
	RandomFinishedChallengesCount int
	RandomOngoingChallenges       []*domain.Challenge
	RandomOngoingChallengesCount  int
	RandomPendingChallenges       []*domain.Challenge
	RandomPendingChallengesCount  int
	ClosingChallenges             []*domain.Challenge
	ClosingChallengesCount        int
}

type NotFoundInstance

type NotFoundInstance struct {
	*CommonInstance
}

type PrivacyInstance added in v0.0.9

type PrivacyInstance struct {
	*CommonInstance
}

type ProfileInstance

type ProfileInstance struct {
	*CommonInstance
	Summary             *domain.SystemSymmary
	UserSummary         *domain.UserSummary
	Challenges          []*domain.Challenge
	ChallengeCount      int
	FilterArgs          domain.FilterChallengesArgs
	Page                int
	MaxPage             int
	ShowMine            bool
	CreateChallengeForm bool
	CreateArgs          domain.CreateChallengeArgs
	CreatedChallenge    *domain.Challenge
	FormError           error
	TimeLayout          string
}

func (*ProfileInstance) NextPage

func (ins *ProfileInstance) NextPage() int

func (*ProfileInstance) PrevPage

func (ins *ProfileInstance) PrevPage() int

type TermsInstance added in v0.0.9

type TermsInstance struct {
	*CommonInstance
}

Jump to

Keyboard shortcuts

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