handlers

package
v1.3.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 Broadcaster

func Broadcaster(r *http.Request) broadcaster.Broadcaster

func ClaimEvent

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

func CountriesConfig added in v1.1.0

func CountriesConfig(r *http.Request) countrier.Config

func CountriesQ added in v0.2.1

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

func CreateBalance

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

func CtxBalancesQ

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

func CtxBroadcaster

func CtxBroadcaster(broadcaster broadcaster.Broadcaster) func(context.Context) context.Context

func CtxCountriesConfig added in v1.1.0

func CtxCountriesConfig(config countrier.Config) func(context.Context) context.Context

func CtxCountriesQ added in v0.2.1

func CtxCountriesQ(q data.CountriesQ) func(context.Context) context.Context

func CtxEventTypes

func CtxEventTypes(types evtypes.Types) 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 CtxPointPrice

func CtxPointPrice(price config.PointsPrice) func(context.Context) context.Context

func CtxReferralsQ

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

func CtxUserClaims

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

func CtxVerifier

func CtxVerifier(verifier *zk.Verifier) func(context.Context) context.Context

func CtxWithdrawalsQ

func CtxWithdrawalsQ(q data.WithdrawalsQ) 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 DoClaimEventUpdates added in v0.2.1

func DoClaimEventUpdates(
	levels config.Levels,
	referralsQ data.ReferralsQ,
	balancesQ data.BalancesQ,
	countriesQ data.CountriesQ,
	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 EditReferrals

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

func EventTypes

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

func EventsQ

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

func FulfillEvent

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

func GetBalance

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

func GetCountriesConfig added in v0.2.1

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

func GetEvent

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

func GetPointPrice

func GetPointPrice(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 added in v0.2.1

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

func ListEvents

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

func ListWithdrawals

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

func Log

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

func NewBalanceModel added in v1.3.1

func NewBalanceModel(balance data.Balance) resources.Balance

NewBalanceModel forms a balance response without referral fields, which must only be accessed with authorization.

func NewWithdrawalModel added in v1.3.1

func NewWithdrawalModel(w data.Withdrawal) resources.Withdrawal

func PointPrice

func PointPrice(r *http.Request) config.PointsPrice

func ReferralsQ

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

func UserClaims

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

func Verifier

func Verifier(r *http.Request) *zk.Verifier

func VerifyPassport

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

func Withdraw

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

func WithdrawalsQ

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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