users

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MPL-2.0, MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Store adapter

Store is the package state variable which contains database connections

Functions

func CreateUser

func CreateUser(w http.ResponseWriter, r *http.Request)

func DeleteUser

func DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser should be atomic transaction - a single user delete call should delete users detail from every database tables. TODO make delete user atomic

func GetAllUsers

func GetAllUsers(w http.ResponseWriter, r *http.Request)

GetAllUsers returns json array of user list.

func GetGroupsAssignedToUser

func GetGroupsAssignedToUser(w http.ResponseWriter, r *http.Request)

func GetUserDetails

func GetUserDetails(w http.ResponseWriter, r *http.Request)

func GetUserDevicesByType

func GetUserDevicesByType(w http.ResponseWriter, r *http.Request)

GetUserDevicesByType returns all user devices under device types.

func InitStore

func InitStore(con *global.State)

InitStore initialises package state

func InitStoreMock

func InitStoreMock() *userstoremocks.UserStoreMock

InitStoreMock will init mock state of this package

func RemoveUserDevice

func RemoveUserDevice(w http.ResponseWriter, r *http.Request)

RemoveUserDevice removes user device

func TrustUserDevice

func TrustUserDevice(w http.ResponseWriter, r *http.Request)

TrustUserDevice marks certain user device as trusted

func UpdateUser

func UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser updates TRASA user

Types

type CreateUserReq

type CreateUserReq struct {
	User           models.UserWithPass `json:"user"`
	PasswordMethod string              `json:"passMethod"`
}

type CreateUserResp

type CreateUserResp struct {
	User             models.User `json:"user"`
	ConfirmationLink string      `json:"confirmLink"`
}

type UserDetails

type UserDetails struct {
	User           models.User              `json:"user"`
	UserAccessMaps []models.AccessMapDetail `json:"userAccessMaps"`
	UserDevices    []models.UserDevice      `json:"userDevices"`
	UserGroups     []models.Group           `json:"userGroups"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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