user

package
v0.0.0-...-5bdf5b5 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	client.Controller
	GetAddr() string
}

A Controller represents an user client

func FindUserByEmail

func FindUserByEmail(ctx context.Context, email string) (Controller, error)

FindUserByEmail returns the user with the given email

func New

func New(client client.Controller, email string) Controller

New builds a brand new client with a provided password

type User

type User struct {
	client.Controller `xorm:"extends"` //`json:"-" gorm:"foreignKey:ClientID, unique"`
	ID                int64            `xorm:"pk autoincr"`     //`json:"id" gorm:"primaryKey; autoIncrement:true"`
	Default           string           `xorm:"not null unique"` //`json:"default" gorm:"not null, unique"`
	Emails            []string         //`json:"emails" gorm:"not null"`
}

A User represents a client of type user

func (*User) AddEmail

func (user *User) AddEmail(new string) (err error)

AddEmail returns the main email of this client

func (*User) GetAddr

func (user *User) GetAddr() string

GetAddr returns the main email of this client

Jump to

Keyboard shortcuts

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