account

package
v0.0.0-...-88fadfa Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SALT_SIZE         = 32
	SHA_DIGEST_LENGTH = 20
)

Variables

This section is empty.

Functions

func CreateSaltAndVerifier

func CreateSaltAndVerifier(username, password string) (s, v string)

func CreateVerifier

func CreateVerifier(username, password, salt string) (v string)

func EmailExists

func EmailExists(email string) (bool, error)

func UsernameExists

func UsernameExists(username string) (bool, error)

Types

type AccountError

type AccountError struct {
	Username bool `json:"username"`
	Password bool `json:"password"`
	Repeat   bool `json:"repeat"`
	Email    bool `json:"email"`
}

func CreateAccount

func CreateAccount(account *AccountInfo) (AccountError, error)

type AccountInfo

type AccountInfo struct {
	Id              int64  `json:"id,omitempty"`
	Username        string `json:"username,omitempty"`
	Password        string `json:"password,omitempty"`
	V               string `json:"v,omitempty"`
	S               string `json:"s,omitempty"`
	Repeat          string `json:"repeat,omitempty"`
	Gmlevel         int    `json:"gmlevel,omitempty"`
	Email           string `json:"email,omitempty"`
	Joindate        string `json:"joindate,omitempty"`
	Last_ip         string `json:"last_ip,omitempty"`
	Failed_logins   int    `json:"failed_logins,omitempty"`
	Locked          int    `json:"locked,omitempty"`
	Last_login      string `json:"last_login,omitempty"`
	Active_realm_id int    `json:"active_realm_id,omitempty"`
	Expansion       int    `json:"expansion,omitempty"`
	Mutetime        int    `json:"mutetime,omitempty"`
	Locale          int    `json:"locale,omitempty"`
}

func Authenticate

func Authenticate(username, password string) (AccountInfo, error)

func GetAccountInfo

func GetAccountInfo(id int) (AccountInfo, error)

type RealmCharacters

type RealmCharacters struct {
	Realmid  int `json:"realmid,omitempty"`
	Acctid   int `json:"acctid,omitempty"`
	Numchars int `json:"numchars,omitempty"`
}

func GetRealmCharacters

func GetRealmCharacters(id int) ([]RealmCharacters, error)

Jump to

Keyboard shortcuts

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