http

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUser

func GetUser(ctx context.Context) *model.User

func JSON

func JSON(w http.ResponseWriter, i any, httpCode int) error

Types

type ResponseErr

type ResponseErr struct {
	Message string         `json:"message"`
	Trace   string         `json:"trace"`
	Details map[string]any `json:"details"`
}

type ResponseErrBuilder

type ResponseErrBuilder interface {
	WithDetails(map[string]any) ResponseErrBuilder
	WithMessage(string) ResponseErrBuilder
	WithStatusCode(int) ResponseErrBuilder
	WithTrace(string) ResponseErrBuilder
	Ready() ResponseErrReadyToSend
	Send(http.ResponseWriter, *http.Request) error
}

func NewResponseErrBuilder

func NewResponseErrBuilder() ResponseErrBuilder

type ResponseErrReadyToSend

type ResponseErrReadyToSend interface {
	Send(http.ResponseWriter) error
}

func ExtractLimitOffset

func ExtractLimitOffset(r *http.Request) (int, int, ResponseErrReadyToSend)

Jump to

Keyboard shortcuts

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