request

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package request implements standardised ways of issuing outgoing calls to other servces.

Index

Constants

View Source
const (
	GetRequestTimeout = time.Second * 10
)

Variables

Functions

func Create added in v0.1.40

func Create(options CreateOptions) (*http.Request, error)

Create is a convenience function to increase readability in consuming code that needs to create an http.Request instance for calling an external service

func Get

func Get(options GetOptions) (*http.Response, error)

Types

type CreateOptions added in v0.1.40

type CreateOptions struct {
	Body    []byte
	Headers map[string][]string
	Method  string
	Queries map[string][]string
	URL     string
}

CreateOptions provides the input to the Create method

type Doer added in v0.1.41

type Doer interface {
	Do(*http.Request) (*http.Response, error)
}

Doer is an interface that defines an object like http.Client

type GetOptions

type GetOptions struct {
	URL     string
	Headers map[string]string
	Queries map[string]string
}

Jump to

Keyboard shortcuts

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