webserver

package
v0.0.0-...-e582b95 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter() *mux.Router

NewRouter creates the routes for GET and POST

func StartWebServer

func StartWebServer(port string)

Types

type Handler

type Handler struct {
	ServiceName string
}

Handler represents the User API method handler set.

func (*Handler) DeleteAllRecordings

func (handler *Handler) DeleteAllRecordings(ctx context.Context, writer http.ResponseWriter, request *http.Request) error

func (*Handler) DeleteRecording

func (handler *Handler) DeleteRecording(ctx context.Context, writer http.ResponseWriter, request *http.Request) error

func (*Handler) Index

func (handler *Handler) Index(ctx context.Context, writer http.ResponseWriter, request *http.Request) error

Index is used for Docker Healthcheck commands to indicate whether the http server is up and running to take requests

func (*Handler) ListRecordings

func (handler *Handler) ListRecordings(ctx context.Context, writer http.ResponseWriter, request *http.Request) error

ListRecordings will return a json array of recording filenames

func (*Handler) Options

func (handler *Handler) Options(ctx context.Context, writer http.ResponseWriter, request *http.Request) error

type RecordingInfo

type RecordingInfo struct {
	FolderName string   `json:"folder_name"`
	EPC        string   `json:"epc"`
	ProductId  string   `json:"product_id"`
	Timestamp  int64    `json:"timestamp"`
	Video      string   `json:"video"`
	Thumb      string   `json:"thumb"`
	Detections []string `json:"detections"`
}

type RecordingsResponse

type RecordingsResponse struct {
	BaseUrl     string          `json:"base_url"`
	ThumbHeight int             `json:"thumb_height"`
	Recordings  []RecordingInfo `json:"recordings"`
}

func NewRecordingsResponse

func NewRecordingsResponse(count int) RecordingsResponse

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc web.Handler
}

Route struct holds attributes to declare routes

Jump to

Keyboard shortcuts

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