auth

package
v0.5.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: GPL-2.0 Imports: 2 Imported by: 109

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithUser

func ContextWithUser[T any](ctx context.Context, user T) context.Context

func UserFromContext

func UserFromContext[T any](ctx context.Context) (T, bool)

Types

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(users []User) *Authenticator

func (*Authenticator) Verify

func (au *Authenticator) Verify(username string, password string) bool

type User

type User struct {
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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