Help us shape the future of Go! Take the 2026 Go Developer Survey

index

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: BSD-3-Clause Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Provides = wire.NewSet(
	wire.Struct(new(Controller), "*"),
	wire.Struct(new(Service), "*"),
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	V    *common.Values
	Csrf *csrf.Csrf

	IndexService  *Service
	ValuesService *values.Service
}

func (*Controller) ForgetReset added in v0.1.0

func (x *Controller) ForgetReset(ctx context.Context, c *app.RequestContext)

func (*Controller) GetForgetCode added in v0.1.0

func (x *Controller) GetForgetCode(ctx context.Context, c *app.RequestContext)

func (*Controller) GetLoginSms added in v0.1.0

func (x *Controller) GetLoginSms(ctx context.Context, c *app.RequestContext)

func (*Controller) GetRefreshCode

func (x *Controller) GetRefreshCode(ctx context.Context, c *app.RequestContext)

func (*Controller) GetUser

func (x *Controller) GetUser(ctx context.Context, c *app.RequestContext)

func (*Controller) GetUserPhoneCode added in v0.1.0

func (x *Controller) GetUserPhoneCode(ctx context.Context, c *app.RequestContext)

func (*Controller) GetUserTotp added in v0.1.0

func (x *Controller) GetUserTotp(ctx context.Context, c *app.RequestContext)

func (*Controller) Login added in v0.0.29

func (x *Controller) Login(ctx context.Context, c *app.RequestContext)

func (*Controller) LoginSms added in v0.1.0

func (x *Controller) LoginSms(ctx context.Context, c *app.RequestContext)

func (*Controller) LoginTotp added in v0.1.0

func (x *Controller) LoginTotp(ctx context.Context, c *app.RequestContext)

func (*Controller) Logout added in v0.0.29

func (x *Controller) Logout(ctx context.Context, c *app.RequestContext)

func (*Controller) Options added in v0.0.29

func (x *Controller) Options(ctx context.Context, c *app.RequestContext)

func (*Controller) Ping added in v0.0.29

func (x *Controller) Ping(_ context.Context, c *app.RequestContext)

func (*Controller) RefreshToken added in v0.0.29

func (x *Controller) RefreshToken(ctx context.Context, c *app.RequestContext)

func (*Controller) SetUser

func (x *Controller) SetUser(ctx context.Context, c *app.RequestContext)

func (*Controller) SetUserPassword added in v0.1.0

func (x *Controller) SetUserPassword(ctx context.Context, c *app.RequestContext)

func (*Controller) SetUserPhone added in v0.1.0

func (x *Controller) SetUserPhone(ctx context.Context, c *app.RequestContext)

func (*Controller) SetUserTotp added in v0.1.0

func (x *Controller) SetUserTotp(ctx context.Context, c *app.RequestContext)

func (*Controller) UnsetUser

func (x *Controller) UnsetUser(ctx context.Context, c *app.RequestContext)

func (*Controller) Verify added in v0.0.29

func (x *Controller) Verify(ctx context.Context, c *app.RequestContext)

type ForgetResetDto added in v0.1.0

type ForgetResetDto struct {
	Email    string `json:"email,required" vd:"email($)"`
	Code     string `json:"code,required"`
	Password string `json:"password,required"`
}

type GetForgetCodeDto added in v0.1.0

type GetForgetCodeDto struct {
	Email string `query:"email,required" vd:"email($)"`
}

type GetLoginSmsDto added in v0.1.0

type GetLoginSmsDto struct {
	Phone string `query:"phone,required"`
}

type GetUserPhone added in v0.1.0

type GetUserPhone struct {
	Phone string `query:"phone,required"`
}

type LoginDto added in v0.0.29

type LoginDto struct {
	Email    string `json:"email,required" vd:"email($)"`
	Password string `json:"password,required" vd:"len($)>=8"`
}

type LoginResult added in v0.1.0

type LoginResult struct {
	User        model.User
	AccessToken string
}

type LoginSmsDto added in v0.1.0

type LoginSmsDto struct {
	Phone string `json:"phone,required"`
	Code  string `json:"code,required"`
}

type LoginTotpDto added in v0.1.0

type LoginTotpDto struct {
	Email string `json:"email,required" vd:"email($)"`
	Code  string `json:"code,required"`
}

type M added in v0.1.0

type M map[string]interface{}

type OptionsDto added in v0.0.29

type OptionsDto struct {
	Type string `query:"type"`
}

type RefreshTokenDto added in v0.0.29

type RefreshTokenDto struct {
	Code string `json:"code,required"`
}

type Service

type Service struct {
	*common.Inject
	Sessions *sessions.Service
	Tencent  *tencent.Service
}

func (*Service) CreateAccessToken added in v0.1.0

func (x *Service) CreateAccessToken(ctx context.Context, userId string) (ts string, err error)

func (*Service) ForgetReset added in v0.1.0

func (x *Service) ForgetReset(ctx context.Context, dto ForgetResetDto) (err error)

func (*Service) GetForgetCode added in v0.1.0

func (x *Service) GetForgetCode(ctx context.Context, username string) (err error)

func (*Service) GetLoginSms added in v0.1.0

func (x *Service) GetLoginSms(ctx context.Context, phone string) (code string, err error)

func (*Service) GetRefreshCode

func (x *Service) GetRefreshCode(ctx context.Context, userId string) (code string, err error)

func (*Service) GetUser

func (x *Service) GetUser(ctx context.Context, userId string) (data M, err error)

func (*Service) GetUserPhoneCode added in v0.1.0

func (x *Service) GetUserPhoneCode(ctx context.Context, phone string) (code string, err error)

func (*Service) GetUserTotp added in v0.1.0

func (x *Service) GetUserTotp(ctx context.Context, userId string) (totp string, err error)

func (*Service) Login

func (x *Service) Login(ctx context.Context, username string, password string) (r *LoginResult, err error)

func (*Service) LoginSms added in v0.1.0

func (x *Service) LoginSms(ctx context.Context, phone string, code string) (r *LoginResult, err error)

func (*Service) LoginTotp added in v0.1.0

func (x *Service) LoginTotp(ctx context.Context, email string, code string) (r *LoginResult, err error)

func (*Service) Logining added in v0.1.0

func (x *Service) Logining(ctx context.Context, filter bson.M) (u model.User, err error)

func (*Service) Logout added in v0.0.29

func (x *Service) Logout(ctx context.Context, userId string)

func (*Service) RefreshToken added in v0.0.29

func (x *Service) RefreshToken(ctx context.Context, claims passport.Claims, code string) (ts string, err error)

func (*Service) SetUser

func (x *Service) SetUser(ctx context.Context, userId string, update bson.M) (result interface{}, err error)

func (*Service) SetUserPassword added in v0.1.0

func (x *Service) SetUserPassword(ctx context.Context, userId string, old string, password string) (r interface{}, err error)

func (*Service) SetUserPhone added in v0.1.0

func (x *Service) SetUserPhone(ctx context.Context, userId string, phone string, code string) (r interface{}, err error)

func (*Service) SetUserTotp added in v0.1.0

func (x *Service) SetUserTotp(ctx context.Context, userId string, totp string, tss [2]string) (r interface{}, err error)

func (*Service) Verify added in v0.0.29

func (x *Service) Verify(ctx context.Context, ts string) (claims passport.Claims, err error)

func (*Service) WriteLogsetLogined added in v0.1.0

func (x *Service) WriteLogsetLogined(ctx context.Context, data *model.LogsetLogined) (err error)

type SetUserDto added in v0.0.29

type SetUserDto struct {
	Key    string `json:"key,required" vd:"in($, 'email', 'name', 'avatar')"`
	Email  string `json:"email,omitempty" vd:"(Set)$!='Email' || email($);msg:'must be email'"`
	Name   string `json:"name,omitempty"`
	Avatar string `json:"avatar,omitempty"`
}

type SetUserPassword added in v0.1.0

type SetUserPassword struct {
	Old      string `json:"old,required" vd:"len($)>8;msg:'must be greater than 8 characters'"`
	Password string `json:"password,required" vd:"len($)>8;msg:'must be greater than 8 characters'"`
}

type SetUserPhone added in v0.1.0

type SetUserPhone struct {
	Phone string `json:"phone,required"`
	Code  string `json:"code,required"`
}

type SetUserTotp added in v0.1.0

type SetUserTotp struct {
	Totp string    `json:"totp,required"`
	Tss  [2]string `json:"tss,required"`
}

type UnsetUserDto added in v0.0.29

type UnsetUserDto struct {
	Key string `path:"key,required" vd:"in($, 'phone', 'totp', 'lark')"`
}

Jump to

Keyboard shortcuts

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