Saúl Ortega e7b93b8b15 | 6 years ago | |
---|---|---|
.gitignore | 6 years ago | |
LICENSE | 6 years ago | |
README.md | 6 years ago | |
filter.go | 6 years ago | |
generic.go | 6 years ago | |
response.go | 6 years ago |
Simple parser for DataTables server-side processing.
go get -u github.com/saulortega/datatables
import "github.com/saulortega/datatables"
//Parse receive *http.Request and returns a Filter struct
filter, err = datatables.Parse(r)
if err != nil {
//Handle error
}
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
}