user

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

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

Go to latest
Published: Feb 4, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	GetUser(context.Context) *twisk.AuthUser
}

AuthService represents authentication context service

type DB

type DB interface {
	Create(orm.DB, twisk.User) (*twisk.User, error)
	View(orm.DB, int64) (*twisk.User, error)
	List(orm.DB, string, int, int) ([]twisk.User, error)
	Delete(orm.DB, *twisk.User) error
	Update(orm.DB, *twisk.User) (*twisk.User, error)
}

DB represents user database interface

type LoggingService

type LoggingService struct {
	user.User
	// contains filtered or unexported fields
}

LoggingService represents iam logging service

func NewLoggingService

func NewLoggingService(svc user.User, logger twisk.Logger) *LoggingService

NewLoggingService creates new Template logging service

func (*LoggingService) Create

func (ls *LoggingService) Create(ctx context.Context, req *user.CreateReq) (resp *user.Resp, err error)

Create user logging

func (*LoggingService) Delete

func (ls *LoggingService) Delete(ctx context.Context, req *user.IDReq) (resp *user.MessageResp, err error)

Delete user logging

func (*LoggingService) List

func (ls *LoggingService) List(ctx context.Context, req *user.ListReq) (resp *user.ListResp, err error)

List user logging

func (*LoggingService) Update

func (ls *LoggingService) Update(ctx context.Context, req *user.UpdateReq) (resp *user.Resp, err error)

Update user logging

func (*LoggingService) View

func (ls *LoggingService) View(ctx context.Context, req *user.IDReq) (resp *user.Resp, err error)

View user logging

type Securer

type Securer interface {
	Hash(string) string
	Password(string, ...string) bool
}

Securer represents password securing service

type Service

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

Service represents user application service

func New

func New(db *pg.DB, udb DB, rbac twisk.RBACService, sec Securer, auth AuthService) *Service

New creates new user application service

func (*Service) Create

func (s *Service) Create(c context.Context, req *user.CreateReq) (*user.Resp, error)

Create creates a new user account

func (*Service) Delete

func (s *Service) Delete(c context.Context, req *user.IDReq) (*user.MessageResp, error)

Delete deletes a user

func (*Service) List

func (s *Service) List(c context.Context, req *user.ListReq) (*user.ListResp, error)

List returns list of users

func (*Service) Update

func (s *Service) Update(c context.Context, req *user.UpdateReq) (*user.Resp, error)

Update updates user's contact information

func (*Service) View

func (s *Service) View(c context.Context, req *user.IDReq) (*user.Resp, error)

View returns single user

Directories

Path Synopsis
platform

Jump to

Keyboard shortcuts

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