service

package
v1.7.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptRegister

func OptRegister(name string, bf BootFunc)

Types

type BootFunc

type BootFunc func(opts model.Opts) error

type Mail

type Mail struct {
	// contains filtered or unexported fields
}

func NewMail

func NewMail() *Mail

func (*Mail) Boot

func (m *Mail) Boot(opt model.Opts) error

func (*Mail) Enabled

func (m *Mail) Enabled() bool

func (*Mail) NotifyActive

func (m *Mail) NotifyActive(siteAddr, email string, token string) error

func (*Mail) NotifyPasswordReset

func (m *Mail) NotifyPasswordReset(siteAddr, email, token string) error

type Option

type Option struct {
	// contains filtered or unexported fields
}

func NewOption

func NewOption() *Option

func (*Option) Update

func (o *Option) Update(name string, p model.Opts) error

type RoleClaims

type RoleClaims struct {
	jwt.StandardClaims

	Roles []string `json:"roles"`
}

func NewRoleClaims

func NewRoleClaims(subject string, ttl int, roles []string) *RoleClaims

func (*RoleClaims) Uid

func (rc *RoleClaims) Uid() int64

type Token

type Token struct {
}

func NewToken

func NewToken() *Token

func (*Token) Create

func (s *Token) Create(uid string, ttl int, roles ...string) (string, error)

func (*Token) Verify

func (s *Token) Verify(tokenStr string) (*RoleClaims, error)

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser() *User

func (*User) Active

func (u *User) Active(token string) error

func (*User) InviteRequired

func (u *User) InviteRequired() bool

func (*User) PasswordReset

func (u *User) PasswordReset(token, password string) error

func (*User) PasswordResetApply

func (u *User) PasswordResetApply(origin, email string) error

func (*User) PasswordUpdate

func (u *User) PasswordUpdate(uid int64, oldPwd, newPwd string) error

func (*User) SignIn

func (u *User) SignIn(usernameOrEmail, password string, ttl int) (*model.User, error)

func (*User) SignOut

func (u *User) SignOut()

func (*User) Signup

func (u *User) Signup(email, password string, opt model.UserCreateOption) (*model.User, error)

type UserKey added in v1.6.0

type UserKey struct {
	// contains filtered or unexported fields
}

func NewUserKey added in v1.6.0

func NewUserKey() *UserKey

func (*UserKey) ClientStore added in v1.6.0

func (uk *UserKey) ClientStore() *store.ClientStore

func (*UserKey) Create added in v1.6.0

func (uk *UserKey) Create(muk *model.UserKey) error

func (*UserKey) LoadExistClient added in v1.6.0

func (uk *UserKey) LoadExistClient()

func (*UserKey) ResetSecret added in v1.6.0

func (uk *UserKey) ResetSecret(muk *model.UserKey) error

func (*UserKey) Token added in v1.6.0

func (uk *UserKey) Token(ctx context.Context, data *oauth2.GenerateBasic, isGenRefresh bool) (access, refresh string, err error)

Jump to

Keyboard shortcuts

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