queryfilter-example

command module
v0.0.0-...-066358b Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 10 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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