shared

package
v0.0.0-...-5092741 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2016 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// Random data for fingerprint and verification code
	SECRET_KEY   = "SECRET_KEY_GO_HERE"
	VERIFIER_KEY = "VERIFIER_SECRET_KEY_GO_HERE"

	// Auth verifier token expire time = 2 minutes
	AUTH_VERIFIER_EXPIRE_TIME = 2 * 60

	// Session expire time = 15 minutes
	SESSION_EXPIRE_TIME = 15 * 60

	// Session renew time = 3 minutes
	SESSION_RENEW_TIME = 3 * 60
)

Variables

View Source
var BusinessData = make(map[string]*BusinessInfo)

Business data store

View Source
var DB *sql.DB

Global database connection

Functions

This section is empty.

Types

type BusinessInfo

type BusinessInfo struct {
	Id       int
	Country  string
	Language string
}

Business info store

type ConnInfo

type ConnInfo struct {
	Domain       string
	Request      *http.Request
	RequestTime  int64
	Fingerprint  string
	BusinessInfo *BusinessInfo
	UserInfo     *UserInfo
	Response
}

Connection info store

type ErrorMessage

type ErrorMessage struct {
	Message  string `json:"error"`
	Delay    int64  `json:"delay,omitempty"`
	Verifier string `json:"verifier,omitempty"`
}

type Response

type Response struct {
	StatusCode int
	Header     map[string]string
	Body       bytes.Buffer
}

type UserInfo

type UserInfo struct {
	UUID     string `json:"sub"`
	Name     string `json:"name"`
	Language string `json:"userLanguage"`
	Role     string `json:"role"`
	Exp      int64  `json:"exp"`
}

User token

Jump to

Keyboard shortcuts

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