getter

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package getter defines an interface that is used to request results by URL

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Get(ctx context.Context, url string) chan Result // Get returns a channel. Later it sends the response, and closes the channel.
}

Interface is used to request results by URL

type Result

type Result struct {
	Code int           // The http status code
	Body io.ReadCloser // The body - remember the caller of Get is responsible for closing this.
	HTML bool          // Did the content-type header indicates HTML?
	Err  error         // Any error (all other fields will be zero if Err != nil)
}

Result is the result of a Get

Directories

Path Synopsis
Package mockgetter defines a getter.Interface that returns mock results for use in tests
Package mockgetter defines a getter.Interface that returns mock results for use in tests
Package webgetter defines a getter.Interface that gets real results by HTTP
Package webgetter defines a getter.Interface that gets real results by HTTP

Jump to

Keyboard shortcuts

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