Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Set = wire.NewSet( New, NewService, )
Functions ¶
This section is empty.
Types ¶
type Form ¶
type QueryParams ¶
type QueryParams struct { api.QueryParams Username string `schema:"username" json:"username"` Email string `schema:"email" json:"email"` State int `schema:"state" json:"state"` }
func (*QueryParams) ListQueryMods ¶
func (qps *QueryParams) ListQueryMods(limit, offset int) []qm.QueryMod
func (*QueryParams) QueryMods ¶
func (qps *QueryParams) QueryMods() (mods []qm.QueryMod)
func (*QueryParams) Validate ¶
func (qps *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 ¶
type Service ¶
type Service interface { Count(ctx context.Context, qps *QueryParams) (int64, error) Query(ctx context.Context, limit, offset int, qps *QueryParams) (models.UserSlice, error) Create(ctx context.Context, form *Form) (*User, error) Update(ctx context.Context, id uint64, form *Form) (*User, error) Get(ctx context.Context, id uint64) (*User, error) Delete(ctx context.Context, id uint64) error Logout() error }
func NewService ¶
func NewService(enforcer *casbin.Enforcer) Service
Click to show internal directories.
Click to hide internal directories.