model

package
v0.0.0-...-cc36037 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2018 License: Unlicense Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const (
	KindUnknown = Kind("")
	KindMatch   = Kind("Match")
	KindUser    = Kind("User")
)
View Source
const (
	MatchStatusInvalid    = ""
	MatchStatusWaiting    = "WAITING_FOR_OPPONENT"
	MatchStatusReady      = "READY"
	MatchStatusInProgress = "IN_PROGRESS"
	MatchStatusCompleted  = "COMPLETED"
)

Variables

This section is empty.

Functions

func EncodeID

func EncodeID(kind Kind, rawID string) string

Types

type ErrJoinedOwnMatch

type ErrJoinedOwnMatch struct{}

func (ErrJoinedOwnMatch) Error

func (ErrJoinedOwnMatch) Error() string

func (ErrJoinedOwnMatch) Type

func (ErrJoinedOwnMatch) Type() string

type ErrMatchAlreadyFull

type ErrMatchAlreadyFull struct{}

func (ErrMatchAlreadyFull) Error

func (ErrMatchAlreadyFull) Error() string

func (ErrMatchAlreadyFull) Type

func (ErrMatchAlreadyFull) Type() string

type ErrMatchNotFound

type ErrMatchNotFound struct{}

func (ErrMatchNotFound) Error

func (ErrMatchNotFound) Error() string

func (ErrMatchNotFound) Type

func (ErrMatchNotFound) Type() string

type Error

type Error interface {
	error

	// Type is the kind of error being returned.
	//
	// It will be unique across all error scenario's
	// and can be used by a client to form their
	// own error messages or make decisions about
	// whether an error needs to be displayed.
	Type() string
}

type Kind

type Kind string

func DecodeID

func DecodeID(encodedID string) (Kind, string)

type Match

type Match struct {
	ID        string
	Owner     string
	Opponent  string
	BoardSize int
}

func (Match) Status

func (m Match) Status() MatchStatus

type MatchStatus

type MatchStatus string

type User

type User struct {
	ID       string
	Username string
}

Jump to

Keyboard shortcuts

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