Documentation ¶
Index ¶
- func ActivateBalance(w http.ResponseWriter, r *http.Request)
- func AuthMiddleware(auth *auth.Client, log *logan.Entry) func(http.Handler) http.Handler
- func BalancesQ(r *http.Request) data.BalancesQ
- func CheckDailyQuestion(w http.ResponseWriter, r *http.Request)
- func ClaimEvent(w http.ResponseWriter, r *http.Request)
- func CreateBalance(w http.ResponseWriter, r *http.Request)
- func CreateDailyQuestion(w http.ResponseWriter, r *http.Request)
- func CreateEventType(w http.ResponseWriter, r *http.Request)
- func CtxBalancesQ(q data.BalancesQ) func(context.Context) context.Context
- func CtxDailyQuestion(v *config.DailyQuestions) func(context.Context) context.Context
- func CtxDailyQuestionsQ(q data.DailyQuestionsQ) func(context.Context) context.Context
- func CtxEventTypes(types *evtypes.Types) func(context.Context) context.Context
- func CtxEventTypesQ(q data.EventTypesQ) func(context.Context) context.Context
- func CtxEventsQ(q data.EventsQ) func(context.Context) context.Context
- func CtxLevels(levels *config.Levels) func(context.Context) context.Context
- func CtxLog(entry *logan.Entry) func(context.Context) context.Context
- func CtxPollVerifier(v *config.PollVerifier) func(context.Context) context.Context
- func CtxReferralsQ(q data.ReferralsQ) func(context.Context) context.Context
- func CtxSigCalculator(calc hmacsig.Calculator) func(context.Context) context.Context
- func CtxUserClaims(claim []resources.Claim) func(context.Context) context.Context
- func CtxVerifiers(v config.Verifiers) func(context.Context) context.Context
- func DBCloneMiddleware(db *pgdb.DB) func(http.Handler) http.Handler
- func DailyQuestions(r *http.Request) *config.DailyQuestions
- func DailyQuestionsQ(r *http.Request) data.DailyQuestionsQ
- func DeleteDailyQuestion(w http.ResponseWriter, r *http.Request)
- func DoClaimEventUpdates(levels *config.Levels, referralsQ data.ReferralsQ, balancesQ data.BalancesQ, ...) (err error)
- func DoLevelRefUpgrade(levels *config.Levels, refQ data.ReferralsQ, balance *data.Balance, ...) (level int, err error)
- func EditDailyQuestion(w http.ResponseWriter, r *http.Request)
- func EditReferrals(w http.ResponseWriter, r *http.Request)
- func EventTypes(r *http.Request) *evtypes.Types
- func EventTypesQ(r *http.Request) data.EventTypesQ
- func EventsQ(r *http.Request) data.EventsQ
- func FilterStartAtDailyQuestions(w http.ResponseWriter, r *http.Request)
- func FulfillPollEvent(w http.ResponseWriter, r *http.Request)
- func FulfillQREvent(w http.ResponseWriter, r *http.Request)
- func GetBalance(w http.ResponseWriter, r *http.Request)
- func GetDailyQuestion(w http.ResponseWriter, r *http.Request)
- func GetDailyQuestionsStatus(w http.ResponseWriter, r *http.Request)
- func GetEvent(w http.ResponseWriter, r *http.Request)
- func GetEventType(w http.ResponseWriter, r *http.Request)
- func Leaderboard(w http.ResponseWriter, r *http.Request)
- func Levels(r *http.Request) *config.Levels
- func ListEventTypes(w http.ResponseWriter, r *http.Request)
- func ListEvents(w http.ResponseWriter, r *http.Request)
- func ListQREventTypes(w http.ResponseWriter, r *http.Request)
- func Log(r *http.Request) *logan.Entry
- func NewDailyQuestionCreate(q *data.DailyQuestion, options []resources.DailyQuestionOptions, ID int64) resources.DailyQuestionDetailsResponse
- func NewDailyQuestionDelete(ID int64, q data.DailyQuestion) (resources.DailyQuestionDetailsResponse, error)
- func NewDailyQuestionEdite(ID int64, q *data.DailyQuestion) (resources.DailyQuestionDetailsResponse, error)
- func NewDailyQuestionModel(question data.DailyQuestion) (resources.DailyQuestionDetails, error)
- func NewDailyQuestionsFilterDate(questions []data.DailyQuestion) (resources.DailyQuestionDetailsListResponse, error)
- func PollVerifier(r *http.Request) *config.PollVerifier
- func ReferralsQ(r *http.Request) data.ReferralsQ
- func SigCalculator(r *http.Request) hmacsig.Calculator
- func UpdateEventType(w http.ResponseWriter, r *http.Request)
- func UserClaims(r *http.Request) []resources.Claim
- func ValidateOptions(options []resources.DailyQuestionOptions) error
- func Verifiers(r *http.Request) config.Verifiers
- func VerifyExternalPassport(w http.ResponseWriter, r *http.Request)
- func VerifyInternalPassport(w http.ResponseWriter, r *http.Request)
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 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 CtxDailyQuestion ¶ added in v1.5.0
func CtxDailyQuestionsQ ¶ added in v1.5.0
func CtxEventTypesQ ¶
func CtxPollVerifier ¶ added in v1.4.0
func CtxReferralsQ ¶
func CtxSigCalculator ¶
func CtxUserClaims ¶
func CtxVerifiers ¶ added in v1.3.0
func DBCloneMiddleware ¶
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 EventTypesQ ¶
func EventTypesQ(r *http.Request) data.EventTypesQ
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 GetEventType ¶
func GetEventType(w http.ResponseWriter, r *http.Request)
func Leaderboard ¶
func Leaderboard(w http.ResponseWriter, r *http.Request)
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 NewDailyQuestionCreate ¶ added in v1.6.0
func NewDailyQuestionCreate(q *data.DailyQuestion, options []resources.DailyQuestionOptions, ID int64) resources.DailyQuestionDetailsResponse
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 ValidateOptions ¶ added in v1.6.0
func ValidateOptions(options []resources.DailyQuestionOptions) error
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.
Source Files ¶
- activate_balance.go
- claim_event.go
- create_balance.go
- create_event_type.go
- ctx.go
- daily_question_check.go
- daily_question_create.go
- daily_question_delete.go
- daily_question_edit.go
- daily_question_get.go
- daily_questions_select.go
- daily_questions_status.go
- edit_referrals.go
- fulfill_poll_event.go
- fulfill_qr_event.go
- get_balance.go
- get_event.go
- get_event_type.go
- leaderboard.go
- list_event_types.go
- list_events.go
- list_qr_event_types.go
- middleware.go
- update_event_type.go
- verify_external_passport.go
- verify_internal_passport.go
Click to show internal directories.
Click to hide internal directories.