Documentation
¶
Index ¶
- Variables
- func ComparePasswordAndHash(password, encodedHash string) (match bool, err error)
- func GenWithParams(p params, pass string) (string, error)
- func PermissionsDecoder(_ bson.DecodeContext, vr bson.ValueReader, val reflect.Value) error
- func PermissionsEncoder(_ bson.EncodeContext, vw bson.ValueWriter, val reflect.Value) error
- type Permission
- type Permissions
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 GenWithParams ¶
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
Click to show internal directories.
Click to hide internal directories.