v1

package
v0.0.0-...-15bed1d Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CURDHandler

func CURDHandler[table model.DBTable](route http.IRoutes)

func ClaimedReward

func ClaimedReward(ctx http.Context)

func CommonHandler

func CommonHandler[paramType any, responseType any](
	apiRoute http.IRoutes,
	handler func(context.Context, *paramType, *responseType) error)

Types

type ClaimedRes

type ClaimedRes struct {
	Reward      map[int]int `json:"reward" mock:""`
	RewardTotal map[int]int `json:"reward_total" mock:""`
}

type ParamClaimed

type ParamClaimed struct {
	Token string `json:"token" bind:"required"`
}

type PostReward

type PostReward[paramType any, responseType any] struct {
	Path     string       `json:"-" default:"/common/claimed"`
	Method   string       `json:"-" default:"/POST"`
	Param    paramType    `json:"-"`
	Response responseType `json:"-"`
	Handler  func(context.Context, *paramType, *responseType) error
}

func PostHandler

func PostHandler[paramType any, responseType any](
	handler func(context.Context, *paramType, *responseType) error,
) *PostReward[paramType, responseType]

Jump to

Keyboard shortcuts

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