uksh-menu-parser

module
v0.0.0-...-c71366f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MIT

README

Docker Image CI Go Coverage Status Go Report Card

uksh-menu-parser

The bistro of the UKSH Lübeck only publishes their lunch menu as a PDF on their Website. This project automatically downloads the lunch plan pdfs and offers their content as json via an REST-API. The price of the meals sometimes glitches a bit as it is extracted via OCR.

Configurations

The following environment variables can be used for configuring the services.

  • SERVER_LISTEN : configures address(es) and port where the server should listen. E.g. use :80 to listen on port 80 on all addresses.
  • USE_SSL : If set to true the server uses https. Set the path to the certificate and private key file in the environment variables SSL_CERT_PATH and SSL_PRIVKEY_PATH.

Endpoints

  • /alive : Just returns some dummy text and Status Code 200/OK. Can be used to monitor the availability of the service.
  • /menu/yyyy-mm-dd : Returns the menu for the given date as a json array.
[
  { Title : string
    Description : string
    Price : string
    Kcal : string
    Type : string
    Date : string // ISO 8601
  }
]

If the date is malformed, to far in the past (varies depending on the menu pdf availability) or more than 7 days in the future, 400/BadRequest is returned. If there is any other error 500/InternalServerError is returned.

Directories

Path Synopsis
cmd
cli
web
mocks
cmd/web
Package mock_main is a generated GoMock package.
Package mock_main is a generated GoMock package.
pkg/parser
Package mock_parser is a generated GoMock package.
Package mock_parser is a generated GoMock package.
pkg

Jump to

Keyboard shortcuts

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