Documentation
¶
Index ¶
- Variables
- func Error(w http.ResponseWriter, r *http.Request, message string, code int, err error)
- func Info(r *http.Request, message string, attrs ...slog.Attr)
- func Mux(ctx context.Context, db *sql.DB) http.Handler
- type Authentication
- type Authorization
- type Credential
- type Email
- type LogOut
- type Revoke
- type SignIn
- type SignUp
- type Token
- type User
- type Verification
- type Verify
Constants ¶
This section is empty.
Variables ¶
View Source
var Configuration = map[string]any{ "POSTGRES_HOST": "localhost:5432", "POSTGRES_USER": "copenhagen", "POSTGRES_PASS": "insecure", "POSTGRES_SSL": false, "TOKEN_ISSUER": hostname, "TOKEN_SECRET": []byte("insecure"), "TOKEN_USE_TLS": false, }
View Source
var ErrInvalidCredential = errors.New("invalid credential")
Functions ¶
Types ¶
type Authentication ¶
func (Authentication) Middleware ¶
func (middleware Authentication) Middleware(route http.HandlerFunc) http.HandlerFunc
type Authorization ¶
func (Authorization) Middleware ¶
func (middleware Authorization) Middleware(route http.HandlerFunc) http.HandlerFunc
type Credential ¶
func (Credential) Authenticate ¶
type Email ¶
type Token ¶
type Verification ¶
type Verification struct { uuid.UUID `db:"link"` Code [8]byte `db:"code"` User uuid.UUID `db:"user"` Expires time.Time `db:"expires"` Data string `db:"data"` }
func NewEmailVerification ¶
func NewEmailVerification(email Email) Verification
Source Files
¶
Click to show internal directories.
Click to hide internal directories.