models

package
v0.0.0-...-8c1cabf Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	*entities.Character `bson:",inline"`

	ID           bson.ObjectId `bson:"_id" json:"id,omitempty"`
	LoginAccount string        `bson:"loginAccount" json:"-"`
}

Character represents a single character of a playerAccount.

type PlayerAccount

type PlayerAccount struct {
	tokauth.Client `bson:",inline"`

	Login      string       `bson:"login" json:"login,omitempty"`
	Password   string       `bson:"password" json:"password,omitempty"`
	Characters []*Character `bson:"characters" json:"characters,omitempty"`
}

PlayerAccount represents the account of a player.

func (*PlayerAccount) Secure

func (p *PlayerAccount) Secure() *PlayerAccount

Secure returns a secured account.

func (*PlayerAccount) ValidateAndCryptPassword

func (p *PlayerAccount) ValidateAndCryptPassword() (err error)

ValidateAndCryptPassword checks if the account have every fields required and crypt the password.

func (*PlayerAccount) WithRefreshToken

func (p *PlayerAccount) WithRefreshToken() *PlayerAccount

WithRefreshToken returns an account with its access Token.

Jump to

Keyboard shortcuts

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