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

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