example

command
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

API Example

This example shows how to create a simple API gateway using the pg package. In order to run this example, you will need to have docker installed (since a new PostgreSQL database will be created for this example):

go run github.com/mutablelogic/go-pg/example@latest

A dataset of about 2.1 million baby names is ingested using a bulk insert operation. Then a HTTP server is started which allows you to perform the following operations:

# Get a list of baby names
curl http://localhost:8080/

# Get a baby name by ID
curl http://localhost:8080/{id}

# Delete a baby name by ID
curl -X DELETE http://localhost:8080/{id}

# Update a baby name by ID
curl -X PATCH http://localhost:8080/{id} -d '{"name": "new name"}'

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