gemini

package
v0.0.0-...-c09411c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusInput          = 10
	StatusSensitiveInput = 11

	StatusSuccess = 20

	StatusRedirectTemporary = 30
	StatusRedirectPermanent = 31

	StatusTemporaryFailure  = 40
	StatusServerUnavailable = 41
	StatusCGIError          = 42
	StatusProxyError        = 43
	StatusSlowDown          = 44

	StatusPermanentFailure    = 50
	StatusNotFound            = 51
	StatusGone                = 52
	StatusProxyRequestRefused = 53
	StatusBadRequest          = 59

	StatusClientCertificateRequired = 60
	StatusCertificateNotAuthorised  = 61
	StatusCertificateNotValid       = 62
)

Variables

View Source
var DefaultClient = Client{}
View Source
var ErrUseLastResponse = errors.New("net/gemini: use last response")

Functions

func StatusText

func StatusText(code int) string

Types

type Client

type Client struct {
	CheckRedirect func(r *Request, via []*Request) error
}

func (Client) Do

func (c Client) Do(req *Request) (*Response, error)

func (Client) Fetch

func (c Client) Fetch(url string) (*Response, error)

type Request

type Request struct {
	URL *url.URL

	Cert *tls.Certificate
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(url string) (*Request, error)

func NewRequestWithContext

func NewRequestWithContext(ctx context.Context, url string) (*Request, error)

type Response

type Response struct {
	StatusCode int
	Meta       string

	Body io.ReadCloser

	Request *Request

	TLS tls.ConnectionState
}

func Fetch

func Fetch(url string) (*Response, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL