qrest

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

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

Go to latest
Published: Aug 4, 2017 License: GPL-2.0 Imports: 8 Imported by: 0

README

qrest

Create a rest api from mariadb for a database. This project was motivated by prest by nuveo

The Works:

To install run,

go get -v github.com/hendra009/qrest1/qrest
go install github.com/hendra009/qrest1/qrest

To start the rest server,

qrest -rport 8000 -host 127.0.0.1 -mport 3306 -user *** -pass *** -database ***

GET:

/table?page=2&pagesize=10
/table?field=value

Where table is the table name in the database.

Returns the result in json format.

PUT:

/table

Request body:

{
    "FIELD1": "string value",
    "FIELD2": 1234567890
}

Insert the JSON data in the request body into the table

POST:

Working on Deletion.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMux

func CreateMux() *mux.Router

func ParseGet

func ParseGet(rw http.ResponseWriter, req *http.Request)

func ParsePost

func ParsePost(rw http.ResponseWriter, req *http.Request)

func ParsePut

func ParsePut(rw http.ResponseWriter, req *http.Request)

func Start

func Start(c config.Config)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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