model

package
v0.0.0-...-8277694 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

MVC models

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginCred

type LoginCred string

a hashed+salted login cred

func NewLoginCred

func NewLoginCred(secret string) LoginCred

generate a new login cred, generates random salt and stores as hashed

func (LoginCred) Check

func (cred LoginCred) Check(passwd string) (is bool)

check if this password matches this login cred

type User

type User struct {
	// name of this user, aka the name part of name@ourb32address.b32.i2p
	Name string `xorm:"pk"`
	// login credential, if empty string login is not allowed
	Login string `xorm:"login"`
	// path to maildir
	MailDirPath string `xorm:"maildir"`
}

mail user info

func (*User) CheckLogin

func (u *User) CheckLogin(passwd string) (ok bool)

check if user's login is correct given password

func (*User) Ensure

func (u *User) Ensure() (err error)

ensure all resources for this user exist returns an error if one occurs while setting up any resources

func (*User) MailDir

func (u *User) MailDir() maildir.MailDir

get user's maildir

Jump to

Keyboard shortcuts

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