ldap

package
v0.0.0-...-08f7bcc Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName service.Name = "ldap"

Variables

This section is empty.

Functions

func EscapeFilter

func EscapeFilter(pattern string, values ...string) string

func ServiceProvider

func ServiceProvider(url string) service.Provider

Types

type SearchOptionFunc

type SearchOptionFunc func(opts *SearchOptions)

func WithAttributes

func WithAttributes(attributes ...string) SearchOptionFunc

func WithBaseDN

func WithBaseDN(dn string) SearchOptionFunc

func WithScope

func WithScope(scope int) SearchOptionFunc

func WithSizeLimit

func WithSizeLimit(sizeLimit int) SearchOptionFunc

type SearchOptions

type SearchOptions struct {
	BaseDN       string
	Scope        int
	DerefAliases int
	SizeLimit    int
	TimeLimit    int
	TypesOnly    bool
	Attributes   []string
	Controls     []ldap.Control
}

type Service

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

func From

func From(container *service.Container) (*Service, error)

From retrieves the ldap service in the given container

func Must

func Must(container *service.Container) *Service

Must retrieves the ldap service in the given container or panic otherwise

func (*Service) Bind

func (s *Service) Bind(dn, password string) error

func (*Service) BindConn

func (s *Service) BindConn(conn *ldap.Conn, dn, password string) error

func (*Service) Connect

func (s *Service) Connect() (*ldap.Conn, error)

func (*Service) ModifyPassword

func (s *Service) ModifyPassword(identity, oldPassword, newPassword string) error

func (*Service) ModifyPasswordConn

func (s *Service) ModifyPasswordConn(conn *ldap.Conn, identity, oldPassword, newPassword string) error

func (*Service) Search

func (s *Service) Search(filter string, opts ...SearchOptionFunc) (*ldap.SearchResult, error)

func (*Service) SearchConn

func (s *Service) SearchConn(conn *ldap.Conn, filter string, opts ...SearchOptionFunc) (*ldap.SearchResult, error)

Jump to

Keyboard shortcuts

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