mockrest

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mockrest provides functionality for creating an http.RoundTripper that can be used with an *http.Client in a *discordgo.Session to handle Discord REST API endpoints and maintain state with a given *discordgo.State.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

func NewTransport(state *discordgo.State) http.RoundTripper

NewTransport returns a new http.RoundTripper that handles requests with respect to the given state.

Types

type RoundTripper

type RoundTripper struct {
	// contains filtered or unexported fields
}

RoundTripper satisfies http.RoundTripper and handles requests using its internal *discordgo.State.

func (*RoundTripper) RoundTrip

func (roundTripper *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip performs the round trip by routing the request to an appropriate handler and returns the result.

Jump to

Keyboard shortcuts

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