http

package
v0.0.0-...-f5bbbf4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPageSize = "100"
)

Variables

This section is empty.

Functions

func WriteHTTPErrorResponse

func WriteHTTPErrorResponse(rw http.ResponseWriter, err error)

func WriteJSON

func WriteJSON(rw http.ResponseWriter, data interface{}) error

func WritePagingResponse

func WritePagingResponse(rw http.ResponseWriter, req *http.Request, data interface{}) error

Types

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message" example:"error message"`
	Code    string `json:"code,omitempty" example:"IR001"`
}

type PagePagingResponse

type PagePagingResponse struct {
	Previous string `json:"previous,omitempty" example:"https://quorum-key-manager.com/stores/your-store/secrets?page=1"`
	Next     string `json:"next,omitempty" example:"https://quorum-key-manager.com/stores/your-store/secrets?page=3"`
}

type PageResponse

type PageResponse struct {
	Data   interface{}        `json:"data" example:"{'item1', 'item2', 'item3'}" swaggertype:"array,string"`
	Paging PagePagingResponse `json:"paging"`
}

Jump to

Keyboard shortcuts

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