server

package
v0.0.0-...-a46ca75 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertBadRequestError

func AssertBadRequestError(t *testing.T, w *httptest.ResponseRecorder)

func AssertDocumentNotFound

func AssertDocumentNotFound(t *testing.T, w *httptest.ResponseRecorder)

func AssertInternalServerError

func AssertInternalServerError(t *testing.T, w *httptest.ResponseRecorder)

func AssertUnauthorized

func AssertUnauthorized(t *testing.T, w *httptest.ResponseRecorder)

Assertion Functions

func ErrorHandler

func ErrorHandler(c *gin.Context)

ErrorHandler a middleware to handle errors

func GinCtx

func GinCtx(c *gin.Context) []interface{}

Gets the context for external services

func GinLoggerMiddleware

func GinLoggerMiddleware(ctx ...interface{}) gin.HandlerFunc

func Router

func Router(ctx ...interface{}) *gin.Engine

func TestDeleteRequest

func TestDeleteRequest(url string, tokenString string) (*http.Request, *httptest.ResponseRecorder)

func TestGetRequest

func TestGetRequest(url string, tokenString string) (*http.Request, *httptest.ResponseRecorder)

func TestPostRequest

func TestPostRequest(url string, body interface{}, tokenString string) (*http.Request, *httptest.ResponseRecorder)

func TestRouter

func TestRouter(ctx ...interface{}) *gin.Engine

Gets Router engine with the appropriate testing context mocking interfaces to external services

func ValidateAuthentication

func ValidateAuthentication(c *gin.Context)

ValidateAuthentication validate gets and check variable body to create new variable puts model.Variable in context as body if everything is correct

Types

type ErrorData

type ErrorData struct {
	Error string `json:"error"`
}

Jump to

Keyboard shortcuts

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