paaks

package module
v0.0.0-...-86eb6b2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const Root = "00000000-0000-0000-0000-000000000000"

Variables

View Source
var Roles = map[int]string{
	1: "USER",
	2: "ADMIN",
	3: "ROOT",
}

Functions

func Filter

func Filter(vs []string, f func(string) bool) []string

func GetConnectionString

func GetConnectionString() string

func GetHostname

func GetHostname() string

func GetSecretKey

func GetSecretKey() string

func IssueError

func IssueError(w http.ResponseWriter, message string, status int)

func Map

func Map[K interface{}, V interface{}](vs []K, f func(K) V) []V

Types

type Token

type Token struct {
	Authorized bool   `json:authorized`
	Role       int    `json:"role"`
	Email      string `json:"email"`
	Tenant     string `json:"tenant"`
	Expiration int    `json:"exp"`
}

func GetToken

func GetToken(r *http.Request) (*Token, error)

type User

type User struct {
	Email        string
	Passwordhash string
	Salt         string
	Fullname     string
	CreateDate   string
	Tenant       string
	Role         int
}

Jump to

Keyboard shortcuts

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