models

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchRandomWorld

func FetchRandomWorld(w *World) error

FetchRandomWorld method returns one world record info.

func GetRandomWorlds

func GetRandomWorlds(count int) (*[]World, error)

GetRandomWorlds method returns world record from db randomly.

func UpdateRandomWorlds

func UpdateRandomWorlds(count int) (*[]World, error)

UpdateRandomWorlds method updates random world records.

Types

type Fortune

type Fortune struct {
	ID      uint16 `json:"id"`
	Message string `json:"message"`
}

Fortune is used for database and reply.

type Fortunes

type Fortunes []*Fortune

Fortunes slice

func GetFortunes

func GetFortunes() (Fortunes, error)

GetFortunes method returns fortunes records

func (Fortunes) Len

func (s Fortunes) Len() int

Sorting interfaces

func (Fortunes) Swap

func (s Fortunes) Swap(i, j int)

type Message

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

Message is used for JSON reply.

type World

type World struct {
	ID           uint16 `json:"id"`
	RandomNumber uint16 `json:"randomNumber"`
}

World is used for database operation.

Jump to

Keyboard shortcuts

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