handler

package
v0.0.0-...-36bd7b3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	TaskHandler
}

func New

func New(services ServiceInterface, log *slog.Logger) *Handler

New returns new instance of the Handler.

type Processor

type Processor interface {
	// FindValues finds min, max, median, average, max increasing sequential and max decreasing sequential of the numbers in the file.
	//
	// If file is not valid, returns error.
	// If file is empty, returns error.
	// If file is valid, returns min, max, median, average, max increasing sequential and max decreasing sequential of the numbers.
	FindValues(form *multipart.Form) (*model.TaskResult, error)
}

type ServiceInterface

type ServiceInterface interface {
	Processor
}

type TaskHandler

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

func (*TaskHandler) FindValues

func (th *TaskHandler) FindValues(c *fiber.Ctx) error

@Summary Find values @Description Web service that receives a `.txt` file with numbers and returns `min`, `max`, `median`, `average`, `max increasing sequential`, `max decreasing sequential` and `execution time` of the numbers. @Tags Task @Accept multipart/form-data @Produce json @Param file formData file true "Please insert your `.txt` file here" @Success 200 {object} model.Response @Failure 400 {object} model.Response @Failure 500 {object} model.Response @Router /task [post].

Jump to

Keyboard shortcuts

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