Go to file
2018-03-01 14:46:10 -05:00
.gitignore Initial commit 2018-02-23 10:01:30 -05:00
filter.go Update and rename datatables.go to filter.go 2018-03-01 14:45:09 -05:00
LICENSE Initial commit 2018-02-23 10:01:30 -05:00
README.md Update README.md 2018-02-28 20:13:20 -05:00
response.go Create response.go 2018-03-01 14:46:10 -05:00

datatables

Simple parser for DataTables server-side processing.

Install

go get -u github.com/saulortega/datatables

Usage

import "github.com/saulortega/datatables"

//Parse receive *http.Request and returns a Filter struct
filter, err = datatables.Parse(r)
if err != nil {
	//Handle error
}

Struct

type Filter struct {
	Draw        int
	Start       int
	Length      int
	Order       []Order
	Columns     []Column
	SearchValue string
	SearchRegex bool
}

type Column struct {
	Data        string
	Name        string
	Index       int
	Orderable   bool
	Searchable  bool
	SearchValue string
	SearchRegex bool
}

type Order struct {
	Column Column
	Dir    string
}