本文整理匯總了Golang中github.com/vjeantet/ldapserver.Message.GetCompareRequest方法的典型用法代碼示例。如果您正苦於以下問題:Golang Message.GetCompareRequest方法的具體用法?Golang Message.GetCompareRequest怎麽用?Golang Message.GetCompareRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/vjeantet/ldapserver.Message
的用法示例。
在下文中一共展示了Message.GetCompareRequest方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: handleCompare
// The resultCode is set to compareTrue, compareFalse, or an appropriate
// error. compareTrue indicates that the assertion value in the ava
// Comparerequest field matches a value of the attribute or subtype according to the
// attribute's EQUALITY matching rule. compareFalse indicates that the
// assertion value in the ava field and the values of the attribute or
// subtype did not match. Other result codes indicate either that the
// result of the comparison was Undefined, or that
// some error occurred.
func handleCompare(w ldap.ResponseWriter, m *ldap.Message) {
r := m.GetCompareRequest()
log.Printf("Comparing entry: %s", r.GetEntry())
//attributes values
log.Printf(" attribute name to compare : \"%s\"", r.GetAttributeValueAssertion().GetName())
log.Printf(" attribute value expected : \"%s\"", r.GetAttributeValueAssertion().GetValue())
res := ldap.NewCompareResponse(ldap.LDAPResultCompareTrue)
w.Write(res)
}