server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Input

func Input(port int) *model.Input

Input receives configuration via HTTP on the port and returns it decoded

Types

type API

type API struct {
	// Expectations is the list of expectations that haven't been met yet
	Expectations []model.Output
	// Errors is the error list populated by doing a Dependabot run
	Errors []error
	// Actual will contain the scenario output that actually happened after the run is Complete
	Actual model.Scenario
	// contains filtered or unexported fields
}

API intercepts calls to the Dependabot API

func NewAPI

func NewAPI(expected []model.Output) *API

NewAPI creates a new API instance and starts the server

func (*API) Complete

func (a *API) Complete()

Complete adds any remaining expectations to the error queue

func (*API) Port

func (a *API) Port() int

Port returns the port the API is listening on

func (*API) ServeHTTP

func (a *API) ServeHTTP(_ http.ResponseWriter, r *http.Request)

ServeHTTP handles requests to the server

func (*API) Stop

func (a *API) Stop()

Stop stops the server

Jump to

Keyboard shortcuts

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