service

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 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 RecycleBin

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

func NewRecycleBin

func NewRecycleBin() *RecycleBin

func (*RecycleBin) Clean

func (rb *RecycleBin) Clean(uid, sid int64) error

func (*RecycleBin) Delete

func (rb *RecycleBin) Delete(uid int64, alias string) error

func (*RecycleBin) FindAll

func (rb *RecycleBin) FindAll(uid int64, sid int64, offset int, limit int) (list []model.Recycle, total int64, err error)

func (*RecycleBin) Recovery

func (rb *RecycleBin) Recovery(uid int64, alias string) 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 Storage

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

func NewStorage

func NewStorage() *Storage

func (*Storage) Create

func (s *Storage) Create(storage *model.Storage) error

func (*Storage) Get

func (s *Storage) Get(id interface{}) (*model.Storage, error)

func (*Storage) GetProvider

func (s *Storage) GetProvider(id interface{}) (provider.Provider, error)

func (*Storage) GetProviderByStorage

func (s *Storage) GetProviderByStorage(storage *model.Storage) (provider.Provider, error)

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