token

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 10 Imported by: 0

README

token

Documentation

Index

Constants

View Source
const QueryCredentials = "SELECT IF(COUNT(*),'true','false') FROM app.credentials WHERE username = ? AND password = ?"

QueryCredentials is a query that executed on DB returns true if both user and password are found in a record.

Variables

This section is empty.

Functions

func CheckLocalCredentials

func CheckLocalCredentials(ctx context.Context, c *Credentials) (bool, error)

CheckLocalCredentials verifies username and passwords on local json file.

func GenerateToken

func GenerateToken(ctx context.Context) (string, error)

GenerateToken generates a token.

func GetToken

func GetToken(ctx context.Context, c *Credentials) (s string, err error)

GetToken generate a uuid like token (does not follow standards).

func TestSearch

func TestSearch(ctx context.Context, c *Credentials) (bool, error)

Types

type Credentials

type Credentials struct {
	User     string
	Hashpass string
}

Credentials is the type used to pass username and password around.

Jump to

Keyboard shortcuts

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