update README
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-12 09:41:26 +11:00
parent d087492c31
commit a3333cebb6
6 changed files with 170 additions and 57 deletions

View File

@@ -26,6 +26,19 @@ func GroupGetByName(groupname string) (Group, error) {
return g, nil
}
// GroupGetById queries the database for the specified group name
func GroupGetById(groupId int) (Group, error) {
var g Group
// Query database for matching group object
err := db.QueryRowx("SELECT * FROM groups WHERE GroupId=?", groupId).StructScan(&g)
if err != nil {
return g, errors.New("group not found")
}
return g, nil
}
// GroupGetByName queries the database for a group with the specified LDAP distinguishedName
func GroupGetByLdapDn(ldapDn string) (Group, error) {
var g Group