http

package
v0.0.0-...-2451bee Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(service subservice.SubscriptionsService) *handler

func NewMiddlewaresProvider

func NewMiddlewaresProvider(log *slog.Logger) *middlewares

func ReadJSON

func ReadJSON[T any](w http.ResponseWriter, r *http.Request, dst T) error

func SubIdParam

func SubIdParam(r *http.Request) (*uuid.UUID, error)

func UserAgentAndIP

func UserAgentAndIP(r *http.Request) (string, string)

func WriteHTTPError

func WriteHTTPError(w http.ResponseWriter, r *http.Request, e *HttpError)

func WriteJSON

func WriteJSON[T any](w http.ResponseWriter, data T, status int, headers http.Header) error

Types

type DTOValidationError

type DTOValidationError struct {
	ClientMessage string
	InternalError error
}

func (*DTOValidationError) Error

func (e *DTOValidationError) Error() string

func (*DTOValidationError) Unwrap

func (e *DTOValidationError) Unwrap() error

type DateLayout

type DateLayout string

type HttpError

type HttpError struct {
	DTOErr dto.Error
	// contains filtered or unexported fields
}

func BadRequestError

func BadRequestError(err error) *HttpError

func InternalError

func InternalError(err error) *HttpError

func NewHTTPError

func NewHTTPError(code int, message string, internalErr error) *HttpError

func (*HttpError) Error

func (e *HttpError) Error() string

func (*HttpError) Unwrap

func (e *HttpError) Unwrap() error

type UpdateSubscriptionRequest

type UpdateSubscriptionRequest struct {
	ServiceName *string         `json:"service_name"`
	MonthlyCost *int            `json:"monthly_cost"`
	EndDate     json.RawMessage `json:"end_date"`
}

Directories

Path Synopsis
Package dto provides primitives to interact with the openapi HTTP API.
Package dto provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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