aboutsummaryrefslogtreecommitdiff
path: root/doc.go
diff options
context:
space:
mode:
authoradnano <[email protected]>2020-10-12 16:49:35 -0400
committeradnano <[email protected]>2020-10-12 16:49:35 -0400
commitcbeb45ff0a14067bd95d4f8cedf8ca5633ab048b (patch)
treedee4d17f9e7ccc1eb15af43d56f9b2e3c1f48923 /doc.go
parentUpdate README.md (diff)
downloadgo-gemini-cbeb45ff0a14067bd95d4f8cedf8ca5633ab048b.tar.xz
go-gemini-cbeb45ff0a14067bd95d4f8cedf8ca5633ab048b.zip
Update documentation
Diffstat (limited to 'doc.go')
-rw-r--r--doc.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc.go b/doc.go
index 3d07754..638eb5c 100644
--- a/doc.go
+++ b/doc.go
@@ -4,10 +4,11 @@ Package gmi implements the Gemini protocol.
Send makes a Gemini request:
req := gmi.NewRequest("gemini://example.com")
- err := gmi.Send(req)
+ resp, err := gmi.Send(req)
if err != nil {
// handle error
}
+ // ...
For control over client behavior, create a Client:
@@ -31,7 +32,7 @@ Clients can control when to trust certificates with TrustCertificate:
return knownHosts.Lookup(hostname, cert)
}
-If a server responds with StatusCertificateRequired, the default client will generate a certificate and resend the request with it. Custom clients can specify GetCertificate:
+If a server responds with StatusCertificateRequired, the default client will generate a certificate and resend the request with it. Custom clients can do so in GetCertificate:
client.GetCertificate = func(hostname string, store *gmi.CertificateStore) *tls.Certificate {
// If the certificate is in the store, return it