messages

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCustomValidations

func RegisterCustomValidations(v *validator.Validate)

Types

type Decorate

type Decorate struct {
	Decoration string `json:"decoration"`
}

type Error

type Error struct {
	Error string `json:"error"`
}

type GameOver

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

type Hello

type Hello struct {
	Version string `json:"version" validate:"semver"`
}

type HostGame

type HostGame struct {
	Nickname string `json:"nickname" validate:"required,max=10,alphanumspace,lowercase"`
}

type JoinGame

type JoinGame struct {
	Nickname string `json:"nickname" validate:"required,max=10,alphanumspace,lowercase,nefield=Host"`
	Host     string `json:"host" validate:"required,max=10,alphanumspace,lowercase"`
}

type Joined

type Joined struct {
	Nickname string `json:"nickname"`
}

type LeaveGame

type LeaveGame struct {
	Nickname string `json:"nickname" validate:"required,max=10,alphanumspace,lowercase"`
	Host     string `json:"host" validate:"required,max=10,alphanumspace,lowercase"`
}

type ListOpenGames

type ListOpenGames struct{}

type OpenGames

type OpenGames struct {
	Hosts []string `json:"hosts"`
}

type PlaceDisk

type PlaceDisk struct {
	Nickname string `json:"nickname" validate:"required,max=10,alphanumspace,lowercase"`
	Host     string `json:"host" validate:"required,max=10,alphanumspace,lowercase"`
	X        int    `json:"x" validate:"min=0,max=7"`
	Y        int    `json:"y" validate:"min=0,max=7"`
}

type StartSoloGame

type StartSoloGame struct {
	Nickname   string `json:"nickname" validate:"required,max=10,alphanumspace,lowercase"`
	Difficulty int    `json:"difficulty" validate:"oneof=0 1 2"`
}

type UpdateBoard

type UpdateBoard struct {
	Board  common.Board `json:"board"`
	Player common.Disk  `json:"player"`
	X      int          `json:"x"`
	Y      int          `json:"y"`
}

type Wrapper

type Wrapper struct {
	Message interface{}
}

func (Wrapper) MarshalJSON

func (w Wrapper) MarshalJSON() ([]byte, error)

func (*Wrapper) UnmarshalJSON

func (w *Wrapper) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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