api

package
v0.0.0-...-56c67ce Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter() *mux.Router

func PingHandler

func PingHandler(w http.ResponseWriter, r *http.Request)

PingHandler will handle the ping route

func Respond

func Respond(w http.ResponseWriter, status int, v interface{}) error

func RespondError

func RespondError(w http.ResponseWriter, status int, err error)

Types

type GenericError

type GenericError struct {
	// Message describing the error
	Error string `json:"error"`
}

Generic API error swagger:response genericError

type PingResponse

type PingResponse struct {
	// The pong generation time (in UTC)
	Pong time.Time `json:"pong"`
}

Ping response payload swagger:response pingResponse

type TestSuite

type TestSuite struct {
	suite.Suite
}

func (*TestSuite) ExecuteRequest

func (suite *TestSuite) ExecuteRequest(router *mux.Router, req *http.Request) *httptest.ResponseRecorder

func (*TestSuite) TestPing

func (suite *TestSuite) TestPing()

Jump to

Keyboard shortcuts

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