response_builder

package
v1.4.4-beta.6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseBuilder

type ResponseBuilder struct {
	// contains filtered or unexported fields
}

func NewResponseBuilder

func NewResponseBuilder(logger logging.Logger) *ResponseBuilder

func (*ResponseBuilder) BadRequest

func (b *ResponseBuilder) BadRequest() ([]byte, int)

func (*ResponseBuilder) BuildResponse

func (b *ResponseBuilder) BuildResponse(response interface{}, status int) ([]byte, int)

func (*ResponseBuilder) NotFound

func (b *ResponseBuilder) NotFound() ([]byte, int)

func (*ResponseBuilder) Ok

func (b *ResponseBuilder) Ok(obj interface{}) ([]byte, int)

func (*ResponseBuilder) OkOrNotFound

func (b *ResponseBuilder) OkOrNotFound(obj interface{}, status int) ([]byte, int)

func (*ResponseBuilder) ServerError

func (b *ResponseBuilder) ServerError(reason interface{}) ([]byte, int)

func (*ResponseBuilder) Write

func (b *ResponseBuilder) Write(w http.ResponseWriter) func(c []byte, s int)

type ResponseObject

type ResponseObject struct {
	Message string `json:"message"`
}

type ResponseObjectWithFailingReason

type ResponseObjectWithFailingReason struct {
	ResponseObject
	Reason interface{} `json:"reason,omitempty"`
}

type ResponseObjectWithResult

type ResponseObjectWithResult struct {
	ResponseObject
	Result interface{} `json:"result,omitempty"`
}

Jump to

Keyboard shortcuts

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