http

package
v0.0.0-...-4f8386e Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 16 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

Overview

Package http contains all methods for working http server.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserUnauthorized           = errors.New("user unauthorized")
	ErrMissingAuthorizationHeader = errors.New("missing authorization header")
	ErrBadAuthorizationString     = errors.New("bad authorization string")
	ErrInvalidArgument            = errors.New("invalid argument")
	ErrMaxAvatarSize              = errors.New("max file size 25 mb")
)

Functions

func LogMiddleware

func LogMiddleware(log *slog.Logger) mux.MiddlewareFunc

LogMiddleware add logger in middleware.

func New

func New(ctx context.Context, applications application) http.Handler

New build and return http.Handler.

func Recoverer

func Recoverer(log *slog.Logger) mux.MiddlewareFunc

Recoverer recover service after a panic.

func SetSessionToCtx

func SetSessionToCtx(app application) mux.MiddlewareFunc

Types

type UploadFilesResponse

type UploadFilesResponse struct {
	FileID uuid.UUID `json:"file_id"`
}

UploadFilesResponse response upload file.

Jump to

Keyboard shortcuts

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