decompract

module
v0.1.1 Latest Latest
Warning

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

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

README

Decompract Go Coverage Status godoc Go Report Card

Build and Deploy

Build a binary file
GOOS=windows GOARCH=386 go build -o builds/decompract.exe ./app
GOOS=linux GOARCH=386 go build -o builds/decompract_linux ./app
GOOS=darwin GOARCH=amd64 go build -o builds/decompract_macos ./app
Environment variables

The application awaits next environment variables provided in .env file in the project folder:

Environment Default Description Example
DEBUG false Turn on debug mode true
SERVICE_URL URL to the backend service http://0.0.0.0:8080/
SERVICE_PORT 8080 Port of the backend servuce 8080
Run the application

Binary file:

decompract server --service_url=http://0.0.0.0:8080/ --service_port=8080
docker-compose up -d
Env file example
DEBUG=true
SERVICE_URL=http://0.0.0.0:8080/
SERVICE_PORT=8080

Backend REST API

Several notes:

  • All timestamps in RFC3339 format, like 2020-06-30T22:01:53+06:00.
  • All durations in RFC3339 format, like 1h30m5s.
  • Clocks should be represented in ISO 8601 format, like 15:04:05.
Errors format
Unauthorized

In case if the user requested a route without proper auth, the 401 status code will be returned with the Unauthorized body content.

General

Example:

{
	"code"     : 0,
	"details"  : "failed to update event",
	"error"    : "event not found"
}

In case of bad client request error might have null value.

Supported error codes for client mapping:

const (
	ErrInternal   ErrCode = 0 // any internal error
	ErrDecode     ErrCode = 1 // failed to unmarshal incoming request
	ErrBadRequest ErrCode = 2 // request contains incorrect data or doesn't contain data
)
Client methods

Directories

Path Synopsis
app
cmd
Package cmd contains all cli commands, their arguments and tests to them
Package cmd contains all cli commands, their arguments and tests to them
num
num/service
Package service provides methods to solve differential equations in num methods, plot graphs of these solutions, calculate errors and plot the graphs of errors.
Package service provides methods to solve differential equations in num methods, plot graphs of these solutions, calculate errors and plot the graphs of errors.

Jump to

Keyboard shortcuts

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