Documentation
¶
Index ¶
- type Authentication
- type AuthenticationType
- type FileAuth
- func (fileAuth *FileAuth) AddUser(username string, httpPassHash string, smtpPassHash string) error
- func (fileAuth *FileAuth) Authenticate(authType AuthenticationType, username string, password string) bool
- func (fileAuth *FileAuth) RequiresAuthentication() bool
- func (fileAuth *FileAuth) UsernamePresent(username string) bool
- type Mongo
- func (mongoClient *Mongo) AddUser(username string, httpPassHash string, smtpPassHash string) error
- func (mongoClient *Mongo) Authenticate(authType AuthenticationType, username string, password string) bool
- func (mongoClient *Mongo) RequiresAuthentication() bool
- func (mongoClient *Mongo) UsernamePresent(username string) bool
- type UserRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
type Authentication interface {
// RequiresAuthentication check is supports auth
RequiresAuthentication() bool
// Authenticate check is credentials valid
Authenticate(authType AuthenticationType, username string, password string) bool
// UsernamePresent check is username exists
UsernamePresent(username string) bool
// AddUser to auth storage
AddUser(username string, httpPassHash string, smtpPassHash string) error
}
Authentication interface represents a backend flow to store or retrieve messages
type AuthenticationType ¶
type AuthenticationType = string
const ( HTTP AuthenticationType = "http" SMTP = "smtp" )
type FileAuth ¶
type FileAuth struct {
// contains filtered or unexported fields
}
FileAuth represents the authentication handler using file
func (*FileAuth) Authenticate ¶
func (fileAuth *FileAuth) Authenticate(authType AuthenticationType, username string, password string) bool
func (*FileAuth) RequiresAuthentication ¶
func (*FileAuth) UsernamePresent ¶
type Mongo ¶ added in v1.0.16
type Mongo struct {
Collection *mongo.Collection
}
func CreateMongoDbAuthentication ¶ added in v1.0.16
func CreateMongoDbAuthentication(collection *mongo.Collection) *Mongo
func (*Mongo) Authenticate ¶ added in v1.0.16
func (mongoClient *Mongo) Authenticate(authType AuthenticationType, username string, password string) bool
func (*Mongo) RequiresAuthentication ¶ added in v1.0.16
func (*Mongo) UsernamePresent ¶ added in v1.0.16
Click to show internal directories.
Click to hide internal directories.