Skip to content

protogodev/httptest

Repository files navigation

httptest

HTTP testing made easy for layered Web applications in Go.

Layered Web Applications

Non-trivial applications should be layered.

layered-app

For layered Web applications:

  • HTTP Server/Client should be separated from Service (i.e. the business rules)
  • HTTP Server should call an interface implemented by Service
  • HTTP Client should implement an interface defined in Service

Installation

Make a custom build of protogo:

$ protogo build --plugin=github.com/protogodev/httptest

Or build from a local fork:

$ protogo build --plugin=github.com/protogodev/httptest=../my-fork
Usage
$ protogo httptest -h
Usage: protogo httptest --mode=STRING --spec=STRING <source-file> <interface-name>

Arguments:
  <source-file>       source-file
  <interface-name>    interface-name

Flags:
  -h, --help           Show context-sensitive help.

      --mode=STRING    generation mode (server or client)
      --spec=STRING    the test specification in YAML
      --out=STRING     output filename (default "./<srcPkgName>_<mode>_test.go")
      --fmt            whether to make the test code formatted

Examples

See examples/usersvc.

Documentation

Check out the Godoc.

License

MIT

About

HTTP testing made easy for layered Web applications in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages