userman

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Module is responsible for user management

func Init

func Init(crud *crud.Module, auth *auth.Module) *Module

Init creates a new instance of the user management object

func (*Module) EmailEditProfile

func (m *Module) EmailEditProfile(ctx context.Context, token, dbType, project, id, email, name, password string) (int, map[string]interface{}, error)

EmailEditProfile allows the user to edit a profile

func (*Module) EmailSignIn

func (m *Module) EmailSignIn(ctx context.Context, dbType, project, email, password string) (int, map[string]interface{}, error)

EmailSignIn signins the user and returns a JWT token

func (*Module) EmailSignUp

func (m *Module) EmailSignUp(ctx context.Context, dbType, project, email, name, password, role string) (int, map[string]interface{}, error)

EmailSignUp signs up a user and return a JWT token

func (*Module) IsActive

func (m *Module) IsActive(method string) bool

IsActive shows if a given method is active

func (*Module) IsEnabled

func (m *Module) IsEnabled() bool

IsEnabled shows if the user management module is enabled

func (*Module) Profile

func (m *Module) Profile(ctx context.Context, token, dbType, project, id string) (int, map[string]interface{}, error)

Profile fetches the profile of the user

func (*Module) Profiles

func (m *Module) Profiles(ctx context.Context, token, dbType, project string) (int, map[string]interface{}, error)

Profiles fetches all the user profiles

func (*Module) SetConfig

func (m *Module) SetConfig(auth config.Auth)

SetConfig set the config required by the user management module

Jump to

Keyboard shortcuts

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