group

package
v5.2.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAdminUser

func AddAdminUser(group *tat.Group, admin string, username string) error

AddAdminUser add an admin to given group

func AddUser

func AddUser(group *tat.Group, admin string, username string) error

AddUser add a user to given group

func ChangeUsernameOnGroups

func ChangeUsernameOnGroups(oldUsername, newUsername string)

ChangeUsernameOnGroups changes a username on groups

func CountGroups

func CountGroups() (int, error)

CountGroups returns the total number of groups in db

func Delete

func Delete(group *tat.Group, user *tat.User) error

Delete deletes a group

func FindByName

func FindByName(groupname string) (*tat.Group, error)

FindByName returns matching group by groupname

func GetGroups

func GetGroups(username string) ([]tat.Group, error)

GetGroups returns all user's groups

func GetUserGroupsOnlyName

func GetUserGroupsOnlyName(username string) ([]string, error)

GetUserGroupsOnlyName returns only groupname of user's groups

func InitDB

func InitDB()

InitDB creates default group if necessary

func Insert

func Insert(group *tat.Group) error

Insert insert new group

func IsGroupnameExists

func IsGroupnameExists(groupname string) bool

IsGroupnameExists return true if groupname exists, false otherwise

func IsUserAdmin

func IsUserAdmin(group *tat.Group, username string) bool

IsUserAdmin return true if user is admin on this group

func ListGroups

func ListGroups(criteria *tat.GroupCriteria, user *tat.User, isAdmin bool) (int, []tat.Group, error)

ListGroups return all groups matching given criteria

func RemoveAdminUser

func RemoveAdminUser(group *tat.Group, admin string, username string) error

RemoveAdminUser remove an admin from a group

func RemoveUser

func RemoveUser(group *tat.Group, admin string, username string) error

RemoveUser remove a user from a group

func Update

func Update(group *tat.Group, newGroupname, description string, user *tat.User) error

Update updates a group : name and description

Types

This section is empty.

Jump to

Keyboard shortcuts

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