user

package
v0.0.0-...-cfbb22e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIncorrectPassword = echo.NewHTTPError(http.StatusBadRequest, "incorrect old password")
	ErrInsecurePassword  = echo.NewHTTPError(http.StatusBadRequest, "insecure password")
)

Custom errors

Functions

This section is empty.

Types

type Service

type Service interface {
	FetchByEmail(echo.Context, string) (authapi.User, error)
	FetchByExternalID(c echo.Context, externalID string) (authapi.User, error)
	ListRoles(echo.Context) ([]authapi.Role, error)
	List(c echo.Context, orgID int) ([]authapi.User, error)
	UpdateRole(c echo.Context, level int, profileID int) error
	FetchProfile(c echo.Context, userID int, orgID int) (authapi.Profile, error)
	FetchUserByUUID(c echo.Context, userUUID uuid.UUID, orgID int) (*authapi.User, error)
	FetchUserByID(c echo.Context, userID int) (authapi.User, error)
	Update(c echo.Context, userUUID uuid.UUID, orgID int, fieldsToUpdate map[string]string) error
}

type User

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

func Initialize

func Initialize(db *sqlx.DB) User

Initialize initalizes user service with defaults

func New

func New(db *sqlx.DB, pdb UserDB) User

New creates new user application service

func (User) FetchByEmail

func (u User) FetchByEmail(c echo.Context, email string) (authapi.User, error)

func (User) FetchByExternalID

func (u User) FetchByExternalID(c echo.Context, externalID string) (authapi.User, error)

func (User) FetchProfile

func (u User) FetchProfile(c echo.Context, userID int, orgID int) (authapi.Profile, error)

func (User) FetchUserByID

func (u User) FetchUserByID(c echo.Context, userID int) (authapi.User, error)

func (User) FetchUserByUUID

func (u User) FetchUserByUUID(c echo.Context, userUUID uuid.UUID, orgID int) (*authapi.User, error)

func (User) List

func (u User) List(c echo.Context, orgID int) ([]authapi.User, error)

func (User) ListRoles

func (u User) ListRoles(c echo.Context) ([]authapi.Role, error)

func (User) Update

func (u User) Update(c echo.Context, userUUID uuid.UUID, orgID int, fieldsToUpdate map[string]string) error

func (User) UpdateRole

func (u User) UpdateRole(c echo.Context, level int, profileID int) error

type UserDB

type UserDB interface {
	List(db sqlx.DB, orgID int) ([]authapi.User, error)
	ListRoles(sqlx.DB) ([]authapi.Role, error)
	UpdateRole(sqlx.DB, int, int) error
	FetchByEmail(sqlx.DB, string) (authapi.User, error)
	FetchByExternalID(db sqlx.DB, externalID string) (authapi.User, error)
	//ListAuthorized(db orm.DB,u *authapi.User, includeInactive bool) ([]authapi.Profile, error)
	FetchProfile(db sqlx.DB, userID int, orgID int) (authapi.Profile, error)
	FetchUserByUUID(db sqlx.DB, userUUID uuid.UUID, orgID int) (*authapi.User, error)
	FetchUserByID(db sqlx.DB, userID int) (authapi.User, error)
	Update(db sqlx.DB, user authapi.User) error
}

Directories

Path Synopsis
platform

Jump to

Keyboard shortcuts

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