models

package
v0.0.0-...-7c24779 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Objects map[string]*Object
)
View Source
var (
	UserList map[string]*User
)

Functions

func AddOne

func AddOne(object Object) (ObjectId string)

func AddUser

func AddUser(u User) string

func Delete

func Delete(ObjectId string)

func DeleteUser

func DeleteUser(uid string)

func GetAll

func GetAll() map[string]*Object

func GetAllUsers

func GetAllUsers() map[string]*User

func Login

func Login(username, password string) bool

func Update

func Update(ObjectId string, Score int64) (err error)

Types

type Object

type Object struct {
	ObjectId   string
	Score      int64
	PlayerName string
}

func GetOne

func GetOne(ObjectId string) (object *Object, err error)

type Profile

type Profile struct {
	Gender  string
	Age     int
	Address string
	Email   string
}

type User

type User struct {
	Id       string
	Username string
	Password string
	Profile  Profile
}

func GetUser

func GetUser(uid string) (u *User, err error)

func UpdateUser

func UpdateUser(uid string, uu *User) (a *User, err error)

Jump to

Keyboard shortcuts

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