util

package
v0.0.0-...-221af98 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToDAO

func ConvertToDAO(titleMaxLength, bodyMaxLength int, st contract.Story) (*model.Story, error)

func ConvertToDTO

func ConvertToDTO(st *model.Story) contract.Story

func ParseRequest

func ParseRequest(req *http.Request, data interface{}) error

func WriteFailureResponse

func WriteFailureResponse(gr resperr.ResponseError, resp http.ResponseWriter)

func WriteSuccessResponse

func WriteSuccessResponse(statusCode int, data interface{}, resp http.ResponseWriter)

Types

type CopyWriter

type CopyWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewCopyWriter

func NewCopyWriter(resp http.ResponseWriter) *CopyWriter

func (*CopyWriter) Body

func (cw *CopyWriter) Body() ([]byte, error)

func (*CopyWriter) Code

func (cw *CopyWriter) Code() int

func (*CopyWriter) Write

func (cw *CopyWriter) Write(b []byte) (int, error)

func (*CopyWriter) WriteHeader

func (cw *CopyWriter) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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