user

package
v0.0.0-...-9b07b7c Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package user contains user application services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Securer

type Securer interface {
	Hash(string) string
}

Securer represents security interface

type Service

Service represents user application interface

type UDB

UDB represents user repository interface

type User

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

User represents user application service

func Initialize

func Initialize(db *gorm.DB, ce *casbin.Enforcer, sec Securer) *User

Initialize initalizes user application service with defaults

func New

func New(db *gorm.DB, ce *casbin.Enforcer, udb UDB, sec Securer) *User

New creates new user application service

func (*User) Create

func (u *User) Create(c echo.Context, req *schemago.ReqCreateUser) (*schemago.SUser, error)

Create creates a new user account

func (*User) Delete

func (u *User) Delete(c echo.Context, userid string) error

Delete deletes a user

func (*User) Disable

func (u *User) Disable(c echo.Context, userid string, active bool) error

Disable updates user's contact information

func (*User) Enable

func (u *User) Enable(c echo.Context, userid string, active bool) error

Enable updates user's contact information

func (*User) Get

func (u *User) Get(c echo.Context, userid string) (*schemago.RespUser, error)

Get returns single user

func (*User) Query

func (u *User) Query(c echo.Context, req *schemago.ReqUser) ([]schemago.RespUser, int, error)

Query returns list of users

func (*User) Update

func (u *User) Update(c echo.Context, req *schemago.ReqUpdateUser) (*schemago.SUser, error)

Update updates user's contact information

Directories

Path Synopsis
platform

Jump to

Keyboard shortcuts

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