Documentation ¶
Index ¶
- Variables
- func Domain(client *adsi.Client, domain string) (data dfsr.Domain, err error)
- func Group(client *adsi.Client, domain, groupName string) (data dfsr.Group, err error)
- type Client
- func (c *Client) Computer(dn string) (computer dfsr.Computer, err error)
- func (c *Client) Domain() (domain dfsr.Domain, err error)
- func (c *Client) Group(groupDN string) (group dfsr.Group, err error)
- func (c *Client) GroupByName(groupName string) (group dfsr.Group, err error)
- func (c *Client) Groups() (groups []dfsr.Group, err error)
- func (c *Client) LocalSettings(settingsDN string) (settings dfsr.LocalSettings, err error)
- func (c *Client) Member(memberDN string) (member dfsr.Member, err error)
- func (c *Client) MemberInfo(memberDN string) (member dfsr.MemberInfo, err error)
- func (c *Client) NamingContext() (nc dfsr.NamingContext, err error)
- type DomainMonitor
- func (m *DomainMonitor) Close()
- func (m *DomainMonitor) Listen() <-chan DomainUpdate
- func (m *DomainMonitor) Start() error
- func (m *DomainMonitor) Stop()
- func (m *DomainMonitor) Update()
- func (m *DomainMonitor) Value() (cfg *dfsr.Domain, timestamp time.Time, err error)
- func (m *DomainMonitor) WaitReady() (err error)
- type DomainUpdate
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClosed is returned from calls to a service or interface in the event // that the Close() function has already been called. ErrClosed = errors.New("interface is closing or already closed") // ErrDomainLookupFailed is returned when the appropriate domain naming // context cannot be determined. ErrDomainLookupFailed = errors.New("unable to determine DFSR configuration domain") )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is capable of perfroming LDAP queries to retrieve DFSR configuration.
func NewClient ¶
NewClient returns a new DFSR configuration client for the given domain.
The provided ADSI client is retained by the global settings and will be used internally to peform the necessary LDAP queries. It is the caller's responsibility to explicitly close the ADSI client at an appropriate time when finished with the global settings.
func (*Client) Group ¶
Group retreives the DFSR group configuration for the given distinguished name.
func (*Client) GroupByName ¶
GroupByName retreives the DFSR group configuration for the given name.
func (*Client) Groups ¶
Groups retreives the DFSR group configuration for all groups contained in the domain.
func (*Client) LocalSettings ¶
func (c *Client) LocalSettings(settingsDN string) (settings dfsr.LocalSettings, err error)
LocalSettings retreives the DFSR local settings for the given distinguished name.
func (*Client) Member ¶
Member retreives the DFSR member configuration for the given distinguished name. The member's connection list is included in the returned data.
func (*Client) MemberInfo ¶
func (c *Client) MemberInfo(memberDN string) (member dfsr.MemberInfo, err error)
MemberInfo retreives the DFSR member configuration for the given distinguished name. The member's connection list is not included in the returned data.
func (*Client) NamingContext ¶
func (c *Client) NamingContext() (nc dfsr.NamingContext, err error)
NamingContext returns information about the default naming context for the domain.
type DomainMonitor ¶
type DomainMonitor struct {
// contains filtered or unexported fields
}
DomainMonitor polls Active Directory for updated domain-wide DFSR configuration.
func NewDomainMonitor ¶
func NewDomainMonitor(domain string, interval, timeout time.Duration) *DomainMonitor
NewDomainMonitor returns a new DFSR configuration monitor that polls Active Directory for updated DFSR configuration for a domain. If the provided domain is an empty string the monitor will attempt to use the the domain of the computer it is running on by querying the root domain naming context.
func (*DomainMonitor) Close ¶
func (m *DomainMonitor) Close()
Close will release resources consumed by the monitor. It should be called when finished with the monitor. Calling close will prevent future calls to start or update from succeeding. Close will not return until all monitor-related goroutines have exited.
func (*DomainMonitor) Listen ¶
func (m *DomainMonitor) Listen() <-chan DomainUpdate
Listen returns a channel on which configuration updates will be broadcast. The channel will be closed when the monitor is closed. If the monitor has already been closed then the returned channel will be closed already.
func (*DomainMonitor) Start ¶
func (m *DomainMonitor) Start() error
Start starts the configuration monitor. If the monitor is already running start does nothing and returns nil. If it is unable to initialize an ADSI client start will return an error. If the monitor is already closed ErrClosed will be returned.
func (*DomainMonitor) Stop ¶
func (m *DomainMonitor) Stop()
Stop stops the monitor and prevents further polling of Active Directory until Start is called again.
func (*DomainMonitor) Update ¶
func (m *DomainMonitor) Update()
Update requests immediate retrieval of configuration data from Active Directory. It does not wait for the retrieval to complete.
If the monitor has not been started Update will do nothing.
func (*DomainMonitor) Value ¶
Value returns the most recently retrieved domain configuration data, or nil if it has not yet acquired any data.
func (*DomainMonitor) WaitReady ¶
func (m *DomainMonitor) WaitReady() (err error)
WaitReady blocks until the monitor has retrieved configuration data. If the monitor has already retrieved data the call will not block.