GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - stefanvanburen/petstore: 🐢🐱πŸͺ

BranchesTags
Open more actions menu

Latest commit

 

History

251 Commits
251 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
internal/petstoreservice
internal/petstoreservice
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
fly.toml
fly.toml
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
justfile
justfile
 
 
main.go
main.go
 
 
wrapper.html.gotmpl
wrapper.html.gotmpl
 
 

Repository files navigation

PetStore 🐢🐱πŸͺ

This is a Go server that implements the PetStoreService API. It's hosted on fly.io, at ps.vanburen.xyz. The source code is at github.com/stefanvanburen/petstore.

Usage

You can interact with the API with plain HTTP requests (via the Connect protocol) with any HTTP client, such as cURL, but buf curl makes it easy:

$ BASE_URL=https://ps.vanburen.xyz/pet.v1.PetStoreService
$ # Create a pet
$ PET_ID=$(buf curl --data '{"name": "Mobin", "petType": "PET_TYPE_CAT"}' "$BASE_URL/PutPet" | jq -r .pet.petId)
$ echo $PET_ID
01GT4XTKXEXY74QD8H575E8NWC

$ # Retrieve a pet
$ DATA="{\"petId\": \"$PET_ID\"}"
$ buf curl --data "$DATA" "$BASE_URL/GetPet" | jq .pet.name
"Mobin"

$ # Delete a pet. :(
$ buf curl --data "$DATA" "$BASE_URL/DeletePet"
{}

You can also use Buf Studio to interact with the API in a much more interactive way.

Implementation details

The server uses the connect-go library to implement the API, with connectrpc/grpcreflect-go adding support for the gRPC server reflection API.

The packages used for interacting with the API are remotely generated - there's no code generation in this repository.

The "database" is completely in memory, so each deploy will wipe out any existing data.

About

🐢🐱πŸͺ

ps.vanburen.xyz

Topics

bufconnectconnect-goprotobuf

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402792 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.