datahub

package module
v0.0.0-...-b17b5ca Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2017 License: MIT Imports: 13 Imported by: 0

README

Datahub

Just a POC :-)

Running

You need to have docker installed, after that just run:

make run

The server is running locally, to upload a file to it:

./tools/upload.sh 127.0.0.1:8080 /tmp/example

To run R code on the server:

./tools/execr.sh 127.0.0.1:8080 /tmp/rcode

R code must work with the files previously uploaded to the server. Because of that the script will always upload examples datasets before uploading your code.

R Examples

If you want to run an R example directly on your machine just run:

cd examples
sudo R -f ./installdeps.r
R -f ./code.r

Example:

curl -XPOST http://192.168.10.169:8080/api/companies/jobs -d '{"title": "Faturamento Presumido de Empresas do Brasil", "description":"Calcular para a Neoway o faturamento presumido de todas as empresas do Brasil baseado no CNAE", "deadline": "2017-04-01", "proposed": 5000, "accuracyRequired": 90.5}'

curl http://192.168.10.169:8080/api/companies/jobs|json_pp

curl -XPOST http://192.168.10.169:8080/api/scientists/4/jobs/5/apply -d '{"counterproposal": 1000}'
curl -XPOST http://192.168.10.169:8080/api/companies/jobs/5/start -d '{"scientists":[{"id":4}]}'
curl http://192.168.10.169:8080/api/scientists/4/jobs/5/workspace|json_pp

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Apply

type Apply struct {
	Counterproposal float64 `json:"counterproposal"`
}

Apply ...

type Jobs

type Jobs struct {
	New     []*company.Job `json:"new,omitempty"`
	Pending []*company.Job `json:"pending"`
	Doing   []*company.Job `json:"doing"`
	Done    []*company.Job `json:"done"`
}

Jobs ...

type Server

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

Server ...

func NewServer

func NewServer() *Server

NewServer ...

func (*Server) Handler

func (d *Server) Handler() http.Handler

Handler ...

func (*Server) ListenAndServe

func (d *Server) ListenAndServe(addr string) error

ListenAndServe ...

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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