utils

package
v0.0.0-...-53e0236 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func In_slice

func In_slice(s string, slice []string) bool

func IpCheck

func IpCheck(thisip string, ips []string) bool

func LDAP_Auth

func LDAP_Auth(lc *LDAP_CONFIG, username, password string) (err error)

func TimeCheck

func TimeCheck(timeRangs []string) bool

Types

type LDAP_CONFIG

type LDAP_CONFIG struct {
	Addr       string   `json:"addr"`
	BaseDn     string   `json:"baseDn"`
	BindDn     string   `json:"bindDn`
	BindPass   string   `json:"bindPass"`
	AuthFilter string   `json:"authFilter"`
	Attributes []string `json:"attributes"`
	TLS        bool     `json:"tls"`
	StartTLS   bool     `json:"startTLS"`
	Conn       *ldap.Conn
}

func (*LDAP_CONFIG) Auth

func (lc *LDAP_CONFIG) Auth(username, password string) (err error)

func (*LDAP_CONFIG) Close

func (lc *LDAP_CONFIG) Close()

func (*LDAP_CONFIG) Connect

func (lc *LDAP_CONFIG) Connect() (err error)

type LDAP_RESULT

type LDAP_RESULT struct {
	DN         string              `json:"dn"`
	Attributes map[string][]string `json:"attributes"`
}

Jump to

Keyboard shortcuts

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