handlers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler defines common part for all handlers

func New

func New(conn *db.Connection) *Handler

New returns new instance of the Handler

func (*Handler) Base

func (h *Handler) Base(handle func(bit.Control)) func(bit.Control)

Base handler implements middleware logic

func (*Handler) Health

func (h *Handler) Health(c bit.Control)

Health returns "OK" if service is alive

func (*Handler) Info

func (h *Handler) Info(c bit.Control)

Info returns detailed info about the service

func (*Handler) NotFound

func (h *Handler) NotFound(c bit.Control)

NotFound responds for undefined methods

func (*Handler) PlayerDetails added in v0.3.0

func (h *Handler) PlayerDetails(c bit.Control)

PlayerDetails shows player information

func (*Handler) PlayerFund added in v0.3.0

func (h *Handler) PlayerFund(c bit.Control)

PlayerFund funds existing player or create new one

func (*Handler) PlayerTake added in v0.3.0

func (h *Handler) PlayerTake(c bit.Control)

PlayerTake takes points from existing player

func (*Handler) Ready

func (h *Handler) Ready(c bit.Control)

Ready returns "OK" if service is ready to serve traffic

func (*Handler) Reset added in v0.3.0

func (h *Handler) Reset(c bit.Control)

Reset makes the DB initialization

func (*Handler) Root

func (h *Handler) Root(c bit.Control)

Root handler shows version

func (*Handler) TournamentAnnounce added in v0.3.0

func (h *Handler) TournamentAnnounce(c bit.Control)

TournamentAnnounce announce existing tournament with specified deposit

func (*Handler) TournamentDetails added in v0.3.0

func (h *Handler) TournamentDetails(c bit.Control)

TournamentDetails shows tournament information

func (*Handler) TournamentJoin added in v0.3.0

func (h *Handler) TournamentJoin(c bit.Control)

TournamentJoin joins players and backers if necessary

func (*Handler) TournamentResult added in v0.3.0

func (h *Handler) TournamentResult(c bit.Control)

TournamentResult finishes the tournament with winners result

type Requests

type Requests struct {
	C2xx int `json:"2xx"`
	C4xx int `json:"4xx"`
	C5xx int `json:"5xx"`
}

Requests contains response codes statistics

type Runtime

type Runtime struct {
	CPU        int    `json:"cpu"`
	Memory     string `json:"memory"`
	Goroutines int    `json:"goroutines"`
}

Runtime defines runtime part of service information

type State

type State struct {
	Maintenance bool   `json:"maintenance"`
	Uptime      string `json:"uptime"`
}

State contains current state of the service

type Status

type Status struct {
	Host     string   `json:"host"`
	Version  string   `json:"version"`
	Commit   string   `json:"commit"`
	Repo     string   `json:"repo"`
	Compiler string   `json:"compiler"`
	Runtime  Runtime  `json:"runtime"`
	State    State    `json:"state"`
	Requests Requests `json:"requests"`
}

Status contains detailed information about service

Jump to

Keyboard shortcuts

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