Skip to content

A minimal and practical example of the queryfilter library in Go

License

Notifications You must be signed in to change notification settings

Tmw/queryfilter-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Queryfilter Example

A minimal and practical example on how to use the Queryfilter library for Go. This is a minimal API implementation with a single endpoint, backed by a SQLite database.

In this example we are pretending we run an online T-shirt shop and we are offering various tshirts. Through the afore mentioned endpoint, we are giving the user of our API the ability to filter on minimum and maximum price, color and size.

Getting started

Getting the project

git clone github.com:Tmw/queryfilter-example.git
cd queryfilter-example

Starting the server

make server

in a separate terminal window, execute:

make call

Note: optionally pipe it to JQ if installed on your system to have a more readable output:

make call | jq

And observe a single tshirt being returned out of the 12 present in the database.

Running the tests Alternatively we can try running the test suite that contains a few test cases we can look at:

make test

License

MIT

About

A minimal and practical example of the queryfilter library in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published