auth

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(db ApiUserRepository) func(next http.Handler) http.Handler

Types

type ApiUser

type ApiUser struct {
	Id       uuid.UUID
	Name     string
	Password []byte
}

func NewApiUser

func NewApiUser(id uuid.UUID, name string, password []byte) ApiUser

func (ApiUser) CheckPassword

func (u ApiUser) CheckPassword(password string) error

type ApiUserRepository

type ApiUserRepository interface {
	GetApiUsers() ([]ApiUser, error)
	GetApiUserById(id uuid.UUID) (ApiUser, error)
	GetApiUserByName(name string) (ApiUser, error)
	SetApiUser(a ApiUser) error
	DeleteApiUserById(id uuid.UUID) error
}

Jump to

Keyboard shortcuts

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