user

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

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

Go to latest
Published: May 7, 2020 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type CreateForm

type CreateForm struct {
	Username string   `schema:"username"`
	Email    string   `schema:"email"`
	Password string   `schema:"password"`
	State    int      `schema:"state"`
	Roles    []string `schema:"roles[]"`
}

func (*CreateForm) Validate

func (f *CreateForm) Validate() error

type QueryParams

type QueryParams struct {
	api.QueryParams
	Username string `json:"username"`
	Email    string `json:"Email"`
	State    string `json:"state"`
}

func (QueryParams) Validate

func (qp QueryParams) Validate() error

type Resource

type Resource struct {
	*api.Application
	// contains filtered or unexported fields
}

func New

func New(
	app *api.Application,
	captchaManager *captchas.Manager,
	jwtManager *core.JWTManager,
	enforcer *casbin.Enforcer,
	service Service,
) *Resource

func (*Resource) RegisterRoutes

func (r *Resource) RegisterRoutes(router clevergo.IRouter)

type Service

type Service interface {
	Count() (uint64, error)
	Query(limit, offset uint64, qps *QueryParams) ([]oldmodels.User, error)
	Create(form *CreateForm) (*models.User, error)
}

func NewService

func NewService(db *sqlex.DB, enforcer *casbin.Enforcer) Service

type User

type User struct {
	oldmodels.User
}

Jump to

Keyboard shortcuts

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