Skip to content

ufukty/petstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Petstore with Gohandlers

This repository implements a petstore example with Gohandlers. Click the link to learn about Gohandlers.

Understanding the files

There are user provided and Gohandlers generated files in this repository. By default Gohandlers suffixes the files it generates with .gh.go.

User provided files

Gohandlers generated files

  • handlers/pets/gh.go contains the builder, parser and validator for request bindings; builder and writer for response bindings and path, method and reference listers for global handlers and method handlers.

  • client/client.gh.go contains the real Client implementation as well as the Interface declaration for using Mock implementation during tests.

  • handlers/pets/gh.yml contains information of handler names, paths and methods that are meant help outside clients.

Runtime output

$ go run .

registering ListPets as GET /pets
registering CreatePet as POST /create-pet
registering DeletePet as DELETE /pets/{id}
registering GetPet as GET /pets/{id}

Re-generating files

find . -name '*.gh.go' -delete
make -B all
git status

About

Demo for Gohandlers

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Contributors