data

package
v0.0.0-...-e304373 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MicroserviceUserPath = "http://microservice-user:9090"

Variables

View Source
var ErrorCharacterNotFound = fmt.Errorf("character not found")

Character specific errors

View Source
var ErrorUserNotFound = fmt.Errorf("user not found")

ErrorUserNotFound : User specific errors

Functions

This section is empty.

Types

type Character

type Character struct {
	ID            string `json:"id" bson:"_id"`
	UserID        string `json:"user_id" bson:"user_id" validate:"required"`
	Name          string `json:"name" validate:"required,name"`
	Alive         bool   `json:"alive"`
	GamesWon      int    `json:"games_won" bson:"games_won"`
	GamesPlayed   int    `json:"games_played" bson:"games_played"`
	EnemiesKilled int    `json:"enemies_killed" bson:"enemies_killed"`
	CreatedOn     string `json:"created_on" bson:"created_on"`
	UpdatedOn     string `json:"updated_on" bson:"updated_on"`
}

Character defines the structure for an API character.

func (*Character) ValidateCharacter

func (character *Character) ValidateCharacter() error

type Characters

type Characters []*Character

Characters is a collection of Character

Jump to

Keyboard shortcuts

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