data

package
v0.0.0-...-471d7c0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2016 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SeedUsers ...
	SeedUsers []models.User
	// SeedUser1 ...
	SeedUser1 models.User
	// SeedUser2 ...
	SeedUser2 models.User
)
View Source
var QueueLength = expvar.NewInt("queue-length")

QueueLength is the total request queue for all users combined. This should be handled by the implementing struct.

View Source
var UserCount = expvar.NewInt("users")

UserCount is the total authenticated live user count. This should be handled by the implementing struct.

Functions

func SeedInit

func SeedInit(jwtPass string) error

SeedInit initializes the seed data. This function needs to be called before accessing the seed data for the first time.

Types

type DB

type DB interface {
	UserDB
}

DB wraps all database related functions.

type Queue

type Queue interface {
	Middleware(ctx *neptulon.ReqCtx) error
	RemoveConn(userID string)
	AddRequest(userID string, method string, params interface{}, resHandler func(ctx *neptulon.ResCtx) error) error
}

Queue is a message queue for queueing and sending messages to users.

type UserDB

type UserDB interface {
	Seed(overwrite bool, jwtPass string) error
	GetByID(id string) (u *models.User, ok bool)
	GetByEmail(email string) (u *models.User, ok bool)
	SaveUser(u *models.User) error
}

UserDB presists user information in database.

Directories

Path Synopsis
Package aws provides AWS implementation of data interfaces.
Package aws provides AWS implementation of data interfaces.

Jump to

Keyboard shortcuts

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