ldap_cache

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[T cacheable] struct {
	// contains filtered or unexported fields
}

func NewCached

func NewCached[T cacheable]() Cache[T]

func (*Cache[T]) Count

func (c *Cache[T]) Count() int

func (*Cache[T]) Filter added in v0.0.3

func (c *Cache[T]) Filter(fn func(T) bool) (v []T)

func (*Cache[T]) Find

func (c *Cache[T]) Find(fn func(T) bool) (v *T, found bool)

func (*Cache[T]) FindByDN

func (c *Cache[T]) FindByDN(dn string) (v *T, found bool)

func (*Cache[T]) Get

func (c *Cache[T]) Get() []T

type FullLDAPComputer

type FullLDAPComputer struct {
	ldap.Computer
	Groups []ldap.Group
}

type FullLDAPGroup

type FullLDAPGroup struct {
	ldap.Group
	Members []ldap.User
}

type FullLDAPUser

type FullLDAPUser struct {
	ldap.User
	Groups []ldap.Group
}

type Manager

type Manager struct {
	Users     Cache[ldap.User]
	Groups    Cache[ldap.Group]
	Computers Cache[ldap.Computer]
	// contains filtered or unexported fields
}

func New

func New(client *ldap.LDAP) *Manager

func (*Manager) FindComputerByDN

func (m *Manager) FindComputerByDN(dn string) (*ldap.Computer, error)

func (*Manager) FindComputers

func (m *Manager) FindComputers(showDisabled bool) []ldap.Computer

func (*Manager) FindGroupByDN

func (m *Manager) FindGroupByDN(dn string) (*ldap.Group, error)

func (*Manager) FindGroups

func (m *Manager) FindGroups() []ldap.Group

func (*Manager) FindUserByDN

func (m *Manager) FindUserByDN(dn string) (*ldap.User, error)

func (*Manager) FindUserBySAMAccountName

func (m *Manager) FindUserBySAMAccountName(samAccountName string) (*ldap.User, error)

func (*Manager) FindUsers

func (m *Manager) FindUsers(showDisabled bool) []ldap.User

func (*Manager) OnAddUserToGroup

func (m *Manager) OnAddUserToGroup(userDN string, groupDN string)

func (*Manager) OnRemoveUserFromGroup

func (m *Manager) OnRemoveUserFromGroup(userDN string, groupDN string)

func (*Manager) PopulateGroupsForComputer

func (m *Manager) PopulateGroupsForComputer(computer *ldap.Computer) *FullLDAPComputer

func (*Manager) PopulateGroupsForUser

func (m *Manager) PopulateGroupsForUser(user *ldap.User) *FullLDAPUser

func (*Manager) PopulateUsersForGroup

func (m *Manager) PopulateUsersForGroup(group *ldap.Group, showDisabled bool) *FullLDAPGroup

func (*Manager) Refresh

func (m *Manager) Refresh()

func (*Manager) RefreshComputers

func (m *Manager) RefreshComputers() error

func (*Manager) RefreshGroups

func (m *Manager) RefreshGroups() error

func (*Manager) RefreshUsers

func (m *Manager) RefreshUsers() error

func (*Manager) Run

func (m *Manager) Run()

func (*Manager) Stop

func (m *Manager) Stop()

Jump to

Keyboard shortcuts

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