handlers

package
v1.6.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateBalance added in v1.1.0

func ActivateBalance(w http.ResponseWriter, r *http.Request)

func AuthMiddleware

func AuthMiddleware(auth *auth.Client, log *logan.Entry) func(http.Handler) http.Handler

func BalancesQ

func BalancesQ(r *http.Request) data.BalancesQ

func CheckDailyQuestion added in v1.5.0

func CheckDailyQuestion(w http.ResponseWriter, r *http.Request)

func ClaimEvent

func ClaimEvent(w http.ResponseWriter, r *http.Request)

func CreateBalance

func CreateBalance(w http.ResponseWriter, r *http.Request)

func CreateDailyQuestion added in v1.6.0

func CreateDailyQuestion(w http.ResponseWriter, r *http.Request)

func CreateEventType

func CreateEventType(w http.ResponseWriter, r *http.Request)

func CtxBalancesQ

func CtxBalancesQ(q data.BalancesQ) func(context.Context) context.Context

func CtxDailyQuestion added in v1.5.0

func CtxDailyQuestion(v *config.DailyQuestions) func(context.Context) context.Context

func CtxDailyQuestionsQ added in v1.5.0

func CtxDailyQuestionsQ(q data.DailyQuestionsQ) func(context.Context) context.Context

func CtxEventTypes

func CtxEventTypes(types *evtypes.Types) func(context.Context) context.Context

func CtxEventTypesQ

func CtxEventTypesQ(q data.EventTypesQ) func(context.Context) context.Context

func CtxEventsQ

func CtxEventsQ(q data.EventsQ) func(context.Context) context.Context

func CtxLevels

func CtxLevels(levels *config.Levels) func(context.Context) context.Context

func CtxLog

func CtxLog(entry *logan.Entry) func(context.Context) context.Context

func CtxPollVerifier added in v1.4.0

func CtxPollVerifier(v *config.PollVerifier) func(context.Context) context.Context

func CtxReferralsQ

func CtxReferralsQ(q data.ReferralsQ) func(context.Context) context.Context

func CtxSigCalculator

func CtxSigCalculator(calc hmacsig.Calculator) func(context.Context) context.Context

func CtxUserClaims

func CtxUserClaims(claim []resources.Claim) func(context.Context) context.Context

func CtxVerifiers added in v1.3.0

func CtxVerifiers(v config.Verifiers) func(context.Context) context.Context

func DBCloneMiddleware

func DBCloneMiddleware(db *pgdb.DB) func(http.Handler) http.Handler

DBCloneMiddleware is designed to clone DB session on each request. You must put all new DB handlers here instead of ape.CtxMiddleware, unless you have a reason to do otherwise.

func DailyQuestions added in v1.5.0

func DailyQuestions(r *http.Request) *config.DailyQuestions

func DailyQuestionsQ added in v1.5.0

func DailyQuestionsQ(r *http.Request) data.DailyQuestionsQ

func DeleteDailyQuestion added in v1.6.0

func DeleteDailyQuestion(w http.ResponseWriter, r *http.Request)

func DoClaimEventUpdates

func DoClaimEventUpdates(
	levels *config.Levels,
	referralsQ data.ReferralsQ,
	balancesQ data.BalancesQ,
	balance *data.Balance,
	reward int64) (err error)

DoClaimEventUpdates do updates which link to claim event: update reserved amount in country; lvlup and update referrals count; accruing points;

Balance must be active and with verified passport

func DoLevelRefUpgrade added in v1.3.0

func DoLevelRefUpgrade(levels *config.Levels, refQ data.ReferralsQ, balance *data.Balance, reward int64) (level int, err error)

DoLevelRefUpgrade calculates new level by provided reward: if level is up, referrals are added

func EditDailyQuestion added in v1.6.0

func EditDailyQuestion(w http.ResponseWriter, r *http.Request)

func EditReferrals

func EditReferrals(w http.ResponseWriter, r *http.Request)

func EventTypes

func EventTypes(r *http.Request) *evtypes.Types

func EventTypesQ

func EventTypesQ(r *http.Request) data.EventTypesQ

func EventsQ

func EventsQ(r *http.Request) data.EventsQ

func FilterStartAtDailyQuestions added in v1.6.0

func FilterStartAtDailyQuestions(w http.ResponseWriter, r *http.Request)

func FulfillPollEvent added in v1.3.0

func FulfillPollEvent(w http.ResponseWriter, r *http.Request)

func FulfillQREvent

func FulfillQREvent(w http.ResponseWriter, r *http.Request)

func GetBalance

func GetBalance(w http.ResponseWriter, r *http.Request)

func GetDailyQuestion added in v1.5.0

func GetDailyQuestion(w http.ResponseWriter, r *http.Request)

func GetDailyQuestionsStatus added in v1.5.0

func GetDailyQuestionsStatus(w http.ResponseWriter, r *http.Request)

func GetEvent

func GetEvent(w http.ResponseWriter, r *http.Request)

func GetEventType

func GetEventType(w http.ResponseWriter, r *http.Request)

func Leaderboard

func Leaderboard(w http.ResponseWriter, r *http.Request)

func Levels

func Levels(r *http.Request) *config.Levels

func ListEventTypes

func ListEventTypes(w http.ResponseWriter, r *http.Request)

func ListEvents

func ListEvents(w http.ResponseWriter, r *http.Request)

func ListQREventTypes added in v0.2.0

func ListQREventTypes(w http.ResponseWriter, r *http.Request)

func Log

func Log(r *http.Request) *logan.Entry

func NewDailyQuestionCreate added in v1.6.0

func NewDailyQuestionDelete added in v1.6.0

func NewDailyQuestionDelete(ID int64, q data.DailyQuestion) (resources.DailyQuestionDetailsResponse, error)

func NewDailyQuestionEdite added in v1.6.0

func NewDailyQuestionEdite(ID int64, q *data.DailyQuestion) (resources.DailyQuestionDetailsResponse, error)

func NewDailyQuestionModel added in v1.6.0

func NewDailyQuestionModel(question data.DailyQuestion) (resources.DailyQuestionDetails, error)

func NewDailyQuestionsFilterDate added in v1.6.0

func NewDailyQuestionsFilterDate(questions []data.DailyQuestion) (resources.DailyQuestionDetailsListResponse, error)

func PollVerifier added in v1.4.0

func PollVerifier(r *http.Request) *config.PollVerifier

func ReferralsQ

func ReferralsQ(r *http.Request) data.ReferralsQ

func SigCalculator

func SigCalculator(r *http.Request) hmacsig.Calculator

func UpdateEventType

func UpdateEventType(w http.ResponseWriter, r *http.Request)

func UserClaims

func UserClaims(r *http.Request) []resources.Claim

func ValidateOptions added in v1.6.0

func ValidateOptions(options []resources.DailyQuestionOptions) error

func Verifiers added in v1.3.0

func Verifiers(r *http.Request) config.Verifiers

func VerifyExternalPassport added in v1.3.0

func VerifyExternalPassport(w http.ResponseWriter, r *http.Request)

func VerifyInternalPassport added in v1.3.0

func VerifyInternalPassport(w http.ResponseWriter, r *http.Request)

VerifyInternalPassport handler processes 3 different flows:

  • Old passport verification with proof for the current release
  • New passport verification with JWT for the future
  • Legacy joining program logic when the client fails to generate query proof

Types

This section is empty.

Jump to

Keyboard shortcuts

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