Documentation
¶
Overview ¶
Package client contains utilities to make Gemini requests
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct {
// Data contains the raw data returned from the server.
// TODO: implement function to pipe this straight to Gemtext parser
Data []byte
// MetaData contains the metadata of the response.
// If StatusCode == 20, it is the MIME type associated with the data
MetaData string
// StatusCode contains the status code returned by the server.
// If this is not 20, Data should be considered to be empty
StatusCode int
}
A Response represents a Gemini response
func Request ¶
Request sends a Gemini request to address tlsConfig will be removed in a future update. Per the tls.Client documentation,
The config cannot be nil: users must set either ServerName or InsecureSkipVerify in the config.
TODO: Does not currently handle redirects.
func TitanRequest ¶ added in v0.4.0
func TitanRequest(address string, tlsConfig *tls.Config, body []byte, token string, mime string) (*Response, error)
TitanRequest sends a request to a Titan server
If token or mime is not desired, an empty string can be passed. The same caveat for tlsConfig as Request applies.
Click to show internal directories.
Click to hide internal directories.