myhttp

package
v0.0.0-...-42c4776 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserTokenHeaderName = "X-Go_P_Zo_UserToken"
	AuthTokenHeaderName = "Authorization"
)

Variables

This section is empty.

Functions

func Write

func Write(w http.ResponseWriter, response interface{}, statusCode int)

func WriteError

func WriteError(w http.ResponseWriter, err error, statusCode int, description string)

func WriteSuccessWithLocation

func WriteSuccessWithLocation(w http.ResponseWriter, response interface{}, statusCode int, location string)

Types

type Header struct {
	UserToken string
}

type ResponseBase

type ResponseBase struct {
	StatusCode int            `json:"statuscode"`
	Error      *myerror.Error `json:"error"`
}

func NewResponse

func NewResponse(err error, statusCode int, description string) *ResponseBase

Jump to

Keyboard shortcuts

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