handler

package
v0.0.0-...-f4abbc8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpinTypeMain = "main"
	SpinTypeFree = "free"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func New

func New(conf *config.Config, proc *processor.Processor) *Handler

New request handler with config and processor

func (*Handler) Spins

func (h *Handler) Spins(w http.ResponseWriter, r *http.Request)

Spins is main method for generates outcome and check it for wins

type PayloadClaims

type PayloadClaims struct {
	Uid   string `json:"uid"`
	Chips int64  `json:"chips"`
	Bet   int64  `json:"bet"`
	jwt.StandardClaims
}

PayloadClaims is type for processing bet data

func (*PayloadClaims) Valid

func (p *PayloadClaims) Valid() error

Valid current request values

type SpinResponse

type SpinResponse struct {
	Total int64                   `json:"total"`
	Spins []*processor.SpinResult `json:"spins"`
	JWT   string                  `json:"jwt"`
}

Jump to

Keyboard shortcuts

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