groups

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Email string

	Groups []*Group
	Users  []*User
}

Group is a 'google group', but in a more useful format than the original libarary provides

func (*Group) AllUsers

func (g *Group) AllUsers() []*User

AllUsers constructs a slice containing all users of the group (including users of all nested groups recursively)

type GroupTree

type GroupTree struct {
	// contains filtered or unexported fields
}

GroupTree is the service that deals with google groups

func CreateGroupTree

func CreateGroupTree(logger *zap.SugaredLogger, domain string, userEmail string, serviceAccountFilePath string, groupBlacklist []string, scopes ...string) (*GroupTree, error)

CreateGroupTree -

func (*GroupTree) Clear

func (g *GroupTree) Clear()

Clear removes all groups and users from the cache

func (*GroupTree) GetGroup

func (g *GroupTree) GetGroup(email string) (*Group, error)

GetGroup -

func (*GroupTree) ListGroupMembersForDisplay added in v1.0.8

func (g *GroupTree) ListGroupMembersForDisplay(groupKey string, includeDerived bool) (result []map[string]interface{}, err error)

ListGroupMembersForDisplay same as ListGroupMembersRaw, but packages them into a better serializable format

func (*GroupTree) ListGroupMembersRaw

func (g *GroupTree) ListGroupMembersRaw(groupKey string) (result []*admin.Member, err error)

ListGroupMembersRaw finds all members in a group

func (*GroupTree) ListUserGroupsForDisplay added in v1.0.8

func (g *GroupTree) ListUserGroupsForDisplay(userKey string) (groups []map[string]interface{}, err error)

ListUserGroupsForDisplay finds all groups a user is a member in. userKey can be primaryEmail, any aliasEmail, or the unique userID

type User

type User struct {
	Email string
}

User is a more useful version of a google user

Jump to

Keyboard shortcuts

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