Skip to content

Commit

Permalink
add LDAPResultCode.AsResult method
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinz01 committed Apr 15, 2024
1 parent 96aeebe commit 759271b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions result.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,14 @@ func (r *IntermediateResponse) Encode() []byte {
w.Write(BerEncodeElement(BerContextSpecificType(1, false), BerEncodeOctetString(r.Value)))
}
return w.Bytes()
}

func (r LDAPResultCode) AsResult(diagnosticMessage string) *Result {
res := &Result{
ResultCode: r,
DiagnosticMessage: diagnosticMessage,
}
return res
}

// Result returned for protocol errors
Expand Down

0 comments on commit 759271b

Please sign in to comment.