Skip to content

Commit

Permalink
add missing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cpuschma committed Oct 31, 2024
1 parent fce8ada commit 7fdf217
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion extended.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
ber "github.com/go-asn1-ber/asn1-ber"
)

// ExtendedRequest TODO
// ExtendedRequest represents an extended request to send to the server
// See: https://www.rfc-editor.org/rfc/rfc4511#section-4.12
type ExtendedRequest struct {
// ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
Expand All @@ -16,6 +16,8 @@ type ExtendedRequest struct {
Value *ber.Packet
}

// NewExtendedRequest returns a new ExtendedRequest. The value can be
// nil depending on the type of request
func NewExtendedRequest(name string, value *ber.Packet) *ExtendedRequest {
return &ExtendedRequest{
Name: name,
Expand All @@ -33,6 +35,9 @@ func (er ExtendedRequest) appendTo(envelope *ber.Packet) error {
return nil
}

// ExtendedResponse represents the response from the directory server
// after sending an extended request
// See: https://www.rfc-editor.org/rfc/rfc4511#section-4.12
type ExtendedResponse struct {
// ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
// COMPONENTS OF LDAPResult,
Expand All @@ -43,6 +48,8 @@ type ExtendedResponse struct {
Value *ber.Packet
}

// Extended performs an extended request. The resulting
// ExtendedResponse may return a value in the form of a *ber.Packet
func (l *Conn) Extended(er *ExtendedRequest) (*ExtendedResponse, error) {
msgCtx, err := l.doRequest(er)
if err != nil {
Expand Down
9 changes: 8 additions & 1 deletion v3/extended.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
ber "github.com/go-asn1-ber/asn1-ber"
)

// ExtendedRequest TODO
// ExtendedRequest represents an extended request to send to the server
// See: https://www.rfc-editor.org/rfc/rfc4511#section-4.12
type ExtendedRequest struct {
// ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
Expand All @@ -16,6 +16,8 @@ type ExtendedRequest struct {
Value *ber.Packet
}

// NewExtendedRequest returns a new ExtendedRequest. The value can be
// nil depending on the type of request
func NewExtendedRequest(name string, value *ber.Packet) *ExtendedRequest {
return &ExtendedRequest{
Name: name,
Expand All @@ -33,6 +35,9 @@ func (er ExtendedRequest) appendTo(envelope *ber.Packet) error {
return nil
}

// ExtendedResponse represents the response from the directory server
// after sending an extended request
// See: https://www.rfc-editor.org/rfc/rfc4511#section-4.12
type ExtendedResponse struct {
// ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
// COMPONENTS OF LDAPResult,
Expand All @@ -43,6 +48,8 @@ type ExtendedResponse struct {
Value *ber.Packet
}

// Extended performs an extended request. The resulting
// ExtendedResponse may return a value in the form of a *ber.Packet
func (l *Conn) Extended(er *ExtendedRequest) (*ExtendedResponse, error) {
msgCtx, err := l.doRequest(er)
if err != nil {
Expand Down

0 comments on commit 7fdf217

Please sign in to comment.