basic

package module
v0.0.0-...-6905d84 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidAuthorization = errors.New(errors.LevelError, http.StatusUnauthorized, "invalid authorization")
)

Functions

func Check

func Check(authorization string, key KeyFunc) (bool, error)

func Generate

func Generate(userName string, password string) string

Types

type Credentials

type Credentials struct {
	UserName string `json:"user_name"`
	Password string `json:"password"`
}

type KeyFunc

type KeyFunc func(username string) (*Credentials, error)

Jump to

Keyboard shortcuts

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