Versions in this module Expand all Collapse all v1 v1.13.0 Dec 24, 2023 Changes in this version type DB + func (db *DB) AddDeniedUser(name string) error + type Denied struct + func (*Denied) Descriptor() ([]byte, []int) + func (*Denied) ProtoMessage() + func (x *Denied) ProtoReflect() protoreflect.Message + func (x *Denied) Reset() + func (x *Denied) String() string type Password + func (x *Password) GetDenied() *Denied + type Password_Denied struct + Denied *Denied v1.11.1 Dec 26, 2023 Changes in this version + var File_userdb_proto protoreflect.FileDescriptor + type DB struct + func Load(fname string) (*DB, error) + func New(fname string) *DB + func (db *DB) AddUser(name, plainPassword string) error + func (db *DB) Authenticate(name, plainPassword string) bool + func (db *DB) Exists(name string) bool + func (db *DB) Reload() error + func (db *DB) RemoveUser(name string) bool + func (db *DB) Write() error + type Password struct + Scheme isPassword_Scheme + func (*Password) Descriptor() ([]byte, []int) + func (*Password) ProtoMessage() + func (m *Password) GetScheme() isPassword_Scheme + func (p *Password) PasswordMatches(plain string) bool + func (x *Password) GetPlain() *Plain + func (x *Password) GetScrypt() *Scrypt + func (x *Password) ProtoReflect() protoreflect.Message + func (x *Password) Reset() + func (x *Password) String() string + type Password_Plain struct + Plain *Plain + type Password_Scrypt struct + Scrypt *Scrypt + type Plain struct + Password []byte + func (*Plain) Descriptor() ([]byte, []int) + func (*Plain) ProtoMessage() + func (p *Plain) PasswordMatches(plain string) bool + func (x *Plain) GetPassword() []byte + func (x *Plain) ProtoReflect() protoreflect.Message + func (x *Plain) Reset() + func (x *Plain) String() string + type ProtoDB struct + Users map[string]*Password + func (*ProtoDB) Descriptor() ([]byte, []int) + func (*ProtoDB) ProtoMessage() + func (x *ProtoDB) GetUsers() map[string]*Password + func (x *ProtoDB) ProtoReflect() protoreflect.Message + func (x *ProtoDB) Reset() + func (x *ProtoDB) String() string + type Scrypt struct + Encrypted []byte + KeyLen int32 + LogN uint64 + P int32 + R int32 + Salt []byte + func (*Scrypt) Descriptor() ([]byte, []int) + func (*Scrypt) ProtoMessage() + func (s *Scrypt) PasswordMatches(plain string) bool + func (x *Scrypt) GetEncrypted() []byte + func (x *Scrypt) GetKeyLen() int32 + func (x *Scrypt) GetLogN() uint64 + func (x *Scrypt) GetP() int32 + func (x *Scrypt) GetR() int32 + func (x *Scrypt) GetSalt() []byte + func (x *Scrypt) ProtoReflect() protoreflect.Message + func (x *Scrypt) Reset() + func (x *Scrypt) String() string