common

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHash = errors.New(
		"the encoded hash is not in the correct format",
	)
	ErrIncompatibleVersion = errors.New("incompatible version of argon2")
)
View Source
var LightParams = params{
	// contains filtered or unexported fields
}
View Source
var PermissionsType = reflect.TypeFor[Permissions]()
View Source
var StdParams = params{
	// contains filtered or unexported fields
}

Functions

func ComparePasswordAndHash

func ComparePasswordAndHash(
	password, encodedHash string,
) (match bool, err error)

func GenWithParams

func GenWithParams(p params, pass string) (string, error)

func PermissionsDecoder

func PermissionsDecoder(
	_ bson.DecodeContext,
	vr bson.ValueReader,
	val reflect.Value,
) error

func PermissionsEncoder

func PermissionsEncoder(
	_ bson.EncodeContext,
	vw bson.ValueWriter,
	val reflect.Value,
) error

Types

type Permission

type Permission = string
const (
	PermissionUser  Permission = "user"
	PermissionAdmin Permission = "admin"
)

type Permissions

type Permissions = mapset.Set[Permission]

func NewPermissions

func NewPermissions(vals ...Permission) Permissions

Jump to

Keyboard shortcuts

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