common

package
v0.0.0-...-4836346 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetListener

func GetListener() net.Listener

func GetQueriesCount

func GetQueriesCount(ctx *fasthttp.RequestCtx) int

func JSONHandler

func JSONHandler(ctx *fasthttp.RequestCtx)

func JSONMarshal

func JSONMarshal(ctx *fasthttp.RequestCtx, v interface{})

func PlaintextHandler

func PlaintextHandler(ctx *fasthttp.RequestCtx)

func RandomWorldNum

func RandomWorldNum() int

func SortFortunesByMessage

func SortFortunesByMessage(fortunes []templates.Fortune)

func SortWorldsByID

func SortWorldsByID(worlds []World)

Types

type JSONResponse

type JSONResponse struct {
	Message string `json:"message"`
}

func (JSONResponse) MarshalEasyJSON

func (v JSONResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (JSONResponse) MarshalJSON

func (v JSONResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*JSONResponse) UnmarshalEasyJSON

func (v *JSONResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*JSONResponse) UnmarshalJSON

func (v *JSONResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type World

type World struct {
	Id           int32 `json:"id"`
	RandomNumber int32 `json:"randomNumber"`
}

func (World) MarshalEasyJSON

func (v World) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (World) MarshalJSON

func (v World) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*World) UnmarshalEasyJSON

func (v *World) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*World) UnmarshalJSON

func (v *World) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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