datahandler

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Service errors
	ErrInternal          = httperror.NewInternalHttpError(errors.New("internal error"), "")
	ErrUnavailable       = httperror.NewExternalHttpError(errors.New("service is off or unavailable"), http.StatusServiceUnavailable)
	SpecialServiceErrors = map[string]httperror.HttpError{
		data.ErrNotEnoughDiskSpace.Error(): httperror.NewExternalHttpError(data.ErrNotEnoughDiskSpace, http.StatusRequestEntityTooLarge),
	}

	// Handler errors
	ErrWrongContextUsername = httperror.NewInternalHttpError(errors.New("context username from jwt is not string"), "")
	ErrBadQuery             = httperror.NewExternalHttpError(errors.New("bad query format"), http.StatusBadRequest)

	// Data info errors
	ErrNullFileSize = httperror.NewExternalHttpError(errors.New("file size is null"), http.StatusBadRequest)
)
View Source
var (
	RequestTimeout = 5 * time.Second
)

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewDataHandler

func NewDataHandler(grpc_client pb.DataServiceClient) Handler

func (Handler) CreateConnection

func (h Handler) CreateConnection(w http.ResponseWriter, r *http.Request)

Use only with auth_middlewares.WithAuth()

func (Handler) GetData

func (h Handler) GetData(w http.ResponseWriter, r *http.Request)

func (Handler) GetSum

func (h Handler) GetSum(w http.ResponseWriter, r *http.Request)

func (Handler) SaveData

func (h Handler) SaveData(w http.ResponseWriter, r *http.Request)

Use only with auth_middlewares.WithAuth()

Jump to

Keyboard shortcuts

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