From bb4bbc5659a506533eb2d45f102ea394e050cee2 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 12 Aug 2023 08:48:11 -0600 Subject: document maxredirects on clients --- gemini/client.go | 5 +++-- spartan/client.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gemini/client.go b/gemini/client.go index b677483..e81e64a 100644 --- a/gemini/client.go +++ b/gemini/client.go @@ -17,14 +17,15 @@ import ( // The only reason you might create more than one Client is to support separate TLS-cert // driven identities. // -// The zero value is a usable Client with no client TLS certificate. +// The zero value is a usable Client with no client TLS certificate and which will not +// follow redirects. type Client struct { MaxRedirects int tlsConf *tls.Config } -// Create a gemini Client with the given TLS configuration. +// NewClient creates a gemini Client with the given TLS configuration and default MaxRedirects. func NewClient(tlsConf *tls.Config) Client { return Client{tlsConf: tlsConf, MaxRedirects: DefaultMaxRedirects} } diff --git a/spartan/client.go b/spartan/client.go index a98949d..9547f74 100644 --- a/spartan/client.go +++ b/spartan/client.go @@ -15,11 +15,12 @@ import ( // // It carries no state and is reusable simultaneously by multiple goroutines. // -// The zero value is immediately usabble. +// The zero value is immediately usabble, but will not follow redirects. type Client struct{ MaxRedirects int } +// NewClient creates a spartan Client which will follow DefaultMaxRedirects. func NewClient() Client { return Client{MaxRedirects: DefaultMaxRedirects} } -- cgit v1.2.3