groups

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MPL-2.0, MPL-2.0 Imports: 12 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 CreateGroup

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

CreateGroup handles grouping of any entity - users, services or policies.

func DeleteGroup

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

func GetAllGroups

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

func GetServiceGroup

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

func GetUserGroup

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

func InitStore

func InitStore(state *global.State)

InitStore initialises package state

func InitStoreMock

func InitStoreMock() *groupMock

InitStoreMock will init mock state of this package

func UpdateGroup

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

UpdateGroup handles grouping of any entity - users, services or policies.

func UpdateServiceGroup

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

func UpdateUsersGroup

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

Types

type GroupApps

type GroupApps struct {
	GroupMeta       models.Group     `json:"groupMeta"`
	AddedServices   []models.Service `json:"addedServices"`
	UnaddedServices []models.Service `json:"unaddedServices"`
}

type GroupUsers

type GroupUsers struct {
	GroupMeta    models.Group  `json:"groupMeta"`
	AddedUsers   []models.User `json:"addedUsers"`
	UnaddedUsers []models.User `json:"unaddedUsers"`
}

type UpdateServiceGroupReq

type UpdateServiceGroupReq struct {
	GroupID    string   `json:"groupID"`
	UpdateType string   `json:"updateType"` // add or delete
	ServiceIDs []string `json:"serviceIDs"`
}

type UpdateUsersGroupReq

type UpdateUsersGroupReq struct {
	GroupID    string   `json:"groupID"`
	UpdateType string   `json:"updateType"` // add or delete
	UserIDs    []string `json:"userIDs",validate:"min=1"`
}

Jump to

Keyboard shortcuts

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