service

package
v0.0.0-...-db25b86 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateLink(origin, email, token string) string

func AdministratorInit

func AdministratorInit()

func Link2Forbidden

func Link2Forbidden() string

func Link2ServerError

func Link2ServerError(err error) string

func Link2SignIn

func Link2SignIn(redirect string) string

func PasswordResetNotify

func PasswordResetNotify(email, link string) error
func PasswordRestLink(origin, email, token string) string

func SignupNotify

func SignupNotify(email, link string) error

func TokenCreate

func TokenCreate(ux string, ttl int, roles ...string) (string, error)

func TokenVerify

func TokenVerify(tokenStr string) (*roleClaims, error)

func UserActivate

func UserActivate(ux string) error

func UserCreate

func UserCreate(email, password string, opt UserCreateOption) error

func UserEmailExist

func UserEmailExist(email string) (*model.User, bool)

func UserGet

func UserGet(ux string) (*model.User, error)

func UserPasswordReset

func UserPasswordReset(ux, newPwd string) error

ResetPassword update the new password

func UserSignIn

func UserSignIn(usernameOrEmail, password string) (*model.User, error)

func UserSignup

func UserSignup(email, password string, opt UserCreateOption) error

func UserTicketExist

func UserTicketExist(ticket string) (*model.User, bool)

func UsernameExist

func UsernameExist(username string) (*model.User, bool)

Types

type User

type User struct {
}

func NewUser

func NewUser() *User

func (*User) FindAll

func (u *User) FindAll(email string, offset, limit int) (list []model.UserFormats, total int64, err error)

type UserCreateOption

type UserCreateOption struct {
	Roles     string
	Ticket    string
	Origin    string
	Activated bool
	// contains filtered or unexported fields
}

func NewUserCreateOption

func NewUserCreateOption() UserCreateOption

Jump to

Keyboard shortcuts

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