當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Message.GetCompareRequest方法代碼示例

本文整理匯總了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)
}
開發者ID:RomainVabre,項目名稱:origin,代碼行數:19,代碼來源:main.go


注:本文中的github.com/vjeantet/ldapserver.Message.GetCompareRequest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。