Help us shape the future of Go! Take the 2026 Go Developer Survey

auth

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: GPL-2.0 Imports: 2 Imported by: 192

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