Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyPattern(input string, pattern string) (string, error)
- func ConvertCacheToLDAPEntries(cachedData *CachedLDAPData) []*ldap.Entry
- func Print(msg string, c int)
- func PrintDebug(msg string)
- func PrintError(msg string)
- func PrintFatal(msg string)
- func PrintInfo(msg string)
- func PrintSuccess(msg string)
- func PrintWarning(msg string)
- func Reverse(s string) string
- func RunLDAPQuery(ldapServer string, ldapPort int, ldapS, ntlm bool, ...)
- func SaveLDAPDataToCache(entries []*ldap.Entry, searchBase, ldapFilter string, attributes []string, ...) error
- func ShouldUpdateCache(cachedData *CachedLDAPData, ldapServer string, ldapPort int) bool
- type CachedLDAPData
- type LDAPEntry
- type PatternReplacement
Constants ¶
const ( SPRING = 0 SUMMER = 1 AUTUMN = 2 WINTER = 3 )
const ( LEET_BASIC = 0 LEET_BASIC_PLUS = 1 )
const ( COMBO = 0 USER = 1 PASS = 2 )
Variables ¶
var ( NoColor = 0 Red = 1 Yellow = 2 Green = 3 Cyan = 4 Blue = 5 Magenta = 6 )
Functions ¶
func ApplyPattern ¶
ApplyPattern applies the pattern replacements to the input string
func ConvertCacheToLDAPEntries ¶
func ConvertCacheToLDAPEntries(cachedData *CachedLDAPData) []*ldap.Entry
ConvertCacheToLDAPEntries converts cache entries back to LDAP entries
func PrintFatal ¶
func PrintFatal(msg string)
func PrintInfo ¶
func PrintInfo(msg string)
PrintInfo prints an info message in cyan with an info symbol
func PrintSuccess ¶
func PrintSuccess(msg string)
PrintSuccess prints a success message in green with a checkmark
func PrintWarning ¶
func PrintWarning(msg string)
PrintWarning prints a warning message in yellow with a warning symbol
func RunLDAPQuery ¶
func SaveLDAPDataToCache ¶
func SaveLDAPDataToCache(entries []*ldap.Entry, searchBase, ldapFilter string, attributes []string, ldapServer string, ldapPort int, cacheFile string) error
SaveLDAPDataToCache stores the LDAP data in a JSON file
func ShouldUpdateCache ¶
func ShouldUpdateCache(cachedData *CachedLDAPData, ldapServer string, ldapPort int) bool
ShouldUpdateCache determines if the cache should be updated based on server information
Types ¶
type CachedLDAPData ¶
type CachedLDAPData struct {
Entries []LDAPEntry `json:"entries"`
CachedAt time.Time `json:"cached_at"`
SearchBase string `json:"search_base"`
LDAPFilter string `json:"ldap_filter"`
Attributes []string `json:"attributes"`
LDAPServer string `json:"ldap_server"`
LDAPPort int `json:"ldap_port"`
}
CachedLDAPData represents the cached LDAP data
func LoadLDAPDataFromCache ¶
func LoadLDAPDataFromCache(cacheFile string) (*CachedLDAPData, error)
LoadLDAPDataFromCache loads the LDAP data from a JSON file
type PatternReplacement ¶
PatternReplacement represents a single pattern replacement rule
func ParsePattern ¶
func ParsePattern(pattern string) ([]PatternReplacement, error)
ParsePattern parses a pattern string in the format "from>to;from2>to2"