From 477d7014edc787ba9a977acd19fcbfc55531768b Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 16 Sep 2021 13:41:01 +0200 Subject: Vendor goldap --- goldap/uri.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 goldap/uri.go (limited to 'goldap/uri.go') diff --git a/goldap/uri.go b/goldap/uri.go new file mode 100644 index 0000000..b57874a --- /dev/null +++ b/goldap/uri.go @@ -0,0 +1,32 @@ +package message + +import "fmt" + +// +// URI ::= LDAPString -- limited to characters permitted in +// -- URIs +func readURI(bytes *Bytes) (uri URI, err error) { + var ldapstring LDAPString + ldapstring, err = readLDAPString(bytes) + // @TODO: check permitted chars in URI + if err != nil { + err = LdapError{fmt.Sprintf("readURI:\n%s", err.Error())} + return + } + uri = URI(ldapstring) + return +} + +// +// URI ::= LDAPString -- limited to characters permitted in +// -- URIs +func (u URI) write(bytes *Bytes) int { + return LDAPString(u).write(bytes) +} + +// +// URI ::= LDAPString -- limited to characters permitted in +// -- URIs +func (u URI) size() int { + return LDAPString(u).size() +} -- cgit v1.2.3