Documentation
¶
Overview ¶
Package http implements a Gatherer for HTTP and HTTPS sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPGatherer ¶
HTTPGatherer gathers resources over HTTP/HTTPS.
func NewHTTPGatherer ¶
func NewHTTPGatherer(opts ...Option) *HTTPGatherer
NewHTTPGatherer returns an HTTPGatherer with a default 30-second timeout.
func (*HTTPGatherer) Gather ¶
func (h *HTTPGatherer) Gather(ctx context.Context, rawSource, dst string) (meta metadata.Metadata, err error)
Gather downloads a file from rawSource via HTTP and writes it to dst.
func (*HTTPGatherer) Matcher ¶
func (h *HTTPGatherer) Matcher(uri string) bool
Matcher returns true if the URI uses an HTTP or HTTPS scheme and is not a known git host.
type HTTPMetadata ¶
HTTPMetadata holds metadata about a gathered HTTP resource.
func (HTTPMetadata) Get ¶
func (h HTTPMetadata) Get() interface{}
Get returns the HTTPMetadata value.
func (HTTPMetadata) GetPinnedURL ¶
func (h HTTPMetadata) GetPinnedURL(u string) (string, error)
GetPinnedURL returns an http:: prefixed URL for the given address.
type Option ¶ added in v1.1.6
type Option func(*HTTPGatherer)
Option configures an HTTPGatherer.
func WithTransport ¶ added in v1.1.6
func WithTransport(t http.RoundTripper) Option
WithTransport sets the http.RoundTripper used by the HTTPGatherer's client.
Click to show internal directories.
Click to hide internal directories.