vbapi

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(recaptchaSecret, dbAddr, dbUser, dbPass, dbName string, ctx *zap.Logger) error

Init configures everything needed for vbapi to work

func RegisterConfirm

func RegisterConfirm(data RegisterConfirmRequest, ip string, ctx *zap.Logger) error

RegisterConfirm registers the user specified by the user object

func RoundActive

func RoundActive(ctx *zap.Logger) (r []vbcore.Round, err error)

RoundActive returns a list of all rounds that are currently active

func RoundJoin

func RoundJoin(userID int, roundID string, ctx *zap.Logger) error

RoundJoin adds the user to the specified round

func RoundentryActive

func RoundentryActive(userID int, ctx *zap.Logger) (response []vbcore.Roundentry, err error)

RoundentryActive loads all roundentry infos for a given user

func RoundentryConnectinfo

func RoundentryConnectinfo(authtoken string, ctx *zap.Logger) (response *vbcore.RoundentryConnectinfo, err error)

RoundentryConnectinfo trades an authtoken for a `vbcore.RoundentryConnectinfo`

func RoundentryWatchresolve

func RoundentryWatchresolve(watchtoken string, ctx *zap.Logger) (websocket string, err error)

RoundentryWatchresolve resolves a watchtoken to it's associated websocket address, so clients only knowing the watchtoken can find their gameserver information publisher

func UserGet

func UserGet(userID int, ctx *zap.Logger) (*vbcore.SafeUser, error)

UserGet returns the full user profile from the database

func UserGetPublicByID

func UserGetPublicByID(userID string, ctx *zap.Logger) (user *vbcore.SafeUser, err error)

UserGetPublicByID returns the public user profile from the database associated with the `userID`.

func UserGetPublicByUsername

func UserGetPublicByUsername(username string, ctx *zap.Logger) (user *vbcore.SafeUser, err error)

UserGetPublicByUsername returns the public user profile from the database associated with the `username`.

func UserUpdate

func UserUpdate(userID int, newUser *vbcore.User, msg string, ctx *zap.Logger) error

UserUpdate updates an old user profile in vbdb with a new user profile

Types

type RegisterConfirmRequest

type RegisterConfirmRequest struct {
	Code         *string      `json:"code"`
	User         *vbcore.User `json:"user"`
	Verification *string      `json:"verification"`
	Recaptcha    *string      `json:"recaptcha"`
}

Jump to

Keyboard shortcuts

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