upload

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: BSD-3-Clause Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute starts the server

func NewRouter

func NewRouter(data *ServiceData) *mux.Router

NewRouter creates the router for HTTP service

func StartWebServer

func StartWebServer(data *ServiceData) error

StartWebServer starts the HTTP service and listens for the requests

Types

type FileResult

type FileResult struct {
	ID string `json:"id"`
}

FileResult - post method response in JSON

type FileSaver

type FileSaver interface {
	Save(name string, reader io.Reader) error
}

FileSaver saves the file with the provided name

type RecognizerMap

type RecognizerMap interface {
	Get(key string) (string, error)
}

RecognizerMap provides the recognizer ID by key

type RecognizerProvider

type RecognizerProvider interface {
	GetAll() ([]*api.Recognizer, error)
}

RecognizerProvider provides available recognizers list

type RequestSaver

type RequestSaver interface {
	Save(data *persistence.Request) error
}

RequestSaver saves the request info to db

type ServiceData

type ServiceData struct {
	FileSaver          FileSaver
	MessageSender      messages.Sender
	StatusSaver        status.Saver
	RequestSaver       RequestSaver
	RecognizerMap      RecognizerMap
	RecognizerProvider RecognizerProvider

	Port int
	// contains filtered or unexported fields
}

ServiceData keeps data required for service work

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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