Documentation
¶
Index ¶
- Constants
- func CheckLocalCredentials(ctx context.Context, c *Credentials) (bool, error)
- func GenerateToken(ctx context.Context) (string, error)
- func GetToken(ctx context.Context, c *Credentials) (s string, err error)
- func TestSearch(ctx context.Context, c *Credentials) (bool, error)
- type Credentials
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 ¶
GenerateToken generates a token.
func GetToken ¶
func GetToken(ctx context.Context, c *Credentials) (s string, err error)
GetToken generates a uuid like token (does not follow standards).
func TestSearch ¶
func TestSearch(ctx context.Context, c *Credentials) (bool, error)
TestSearch looks for credentials in the DB.
Types ¶
type Credentials ¶
Credentials is the type used to pass username and password around.
Click to show internal directories.
Click to hide internal directories.