auth

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

README

Go Auth

Authentication module for Go. Created for personal use.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJWTToken

func CreateJWTToken(secret string) (string, error)

func IsValid

func IsValid(token, secret string) bool

Types

type ErrorBody

type ErrorBody struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

func NewMiddleware

func NewMiddleware(logLevel, apiKey, secret string) *Middleware

func (*Middleware) RequireApiKey

func (m *Middleware) RequireApiKey(next http.Handler) http.Handler

func (*Middleware) RequireAuthCookie

func (m *Middleware) RequireAuthCookie(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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