model

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttrScope      = "scope"
	AttrAud        = "audience"
	AttrCapability = "capability"
)

Defined attributes

Variables

Attributes holds all defined attributes

View Source
var ResponseNYI = Response{Status: fiber.StatusNotImplemented, Response: api.APIErrorNYI}

ResponseNYI is the server response when something is not yet implemented

Functions

This section is empty.

Types

type Response

type Response struct {
	// The Http Status code of the response
	Status int
	// The response body, will be marshalled as json
	Response interface{}
	// Cookies that should be set
	Cookies []*fiber.Cookie
}

Response models a http server response

func ErrorToBadRequestErrorResponse

func ErrorToBadRequestErrorResponse(err error) *Response

ErrorToBadRequestErrorResponse creates a bad request error response from a golang error

func ErrorToInternalServerErrorResponse

func ErrorToInternalServerErrorResponse(err error) *Response

ErrorToInternalServerErrorResponse creates an internal server error response from a golang error

func (Response) Send

func (r Response) Send(ctx *fiber.Ctx) error

Send sends this response using the passed fiber.Ctx

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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