Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Commit cd419db

Browse files
committed
more documentation improvements
1 parent c1e1988 commit cd419db

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

digest_auth_client.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,24 @@ type DigestTransport struct {
2222
Username string
2323
}
2424

25+
// NewRequest creates a new DigestRequest object
2526
func NewRequest(username, password, method, uri, body string) DigestRequest {
2627
dr := DigestRequest{}
2728
dr.UpdateRequest(username, password, method, uri, body)
2829
return dr
2930
}
3031

32+
// NewTransport creates a new DigestTransport object
3133
func NewTransport(username, password string) DigestTransport {
3234
dt := DigestTransport{}
3335
dt.Password = password
3436
dt.Username = username
3537
return dt
3638
}
3739

40+
// UpdateRequest is called when you want to reuse an existing
41+
// DigestRequest connection with new request information
3842
func (dr *DigestRequest) UpdateRequest(username, password, method, uri, body string) *DigestRequest {
39-
4043
dr.Body = body
4144
dr.Method = method
4245
dr.Password = password
@@ -45,6 +48,7 @@ func (dr *DigestRequest) UpdateRequest(username, password, method, uri, body str
4548
return dr
4649
}
4750

51+
// RoundTrip implements the http.RoundTripper interface
4852
func (dt *DigestTransport) RoundTrip(req *http.Request) (resp *http.Response, err error) {
4953
username := dt.Username
5054
password := dt.Password
@@ -62,6 +66,7 @@ func (dt *DigestTransport) RoundTrip(req *http.Request) (resp *http.Response, er
6266
return dr.Execute()
6367
}
6468

69+
// Execute initialise the request and get a response
6570
func (dr *DigestRequest) Execute() (resp *http.Response, err error) {
6671

6772
if dr.Auth == nil {

0 commit comments

Comments
 (0)