canner

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 13 Imported by: 0

README

Build Go Report Card License

Canner is a server that provides configurable mock http server written in go. This server supports

Features

  • Coming Soon: Support for simulation of network errors
  • Support for injection of a latency delay into the response. Currently simple and random latency modes are supported. Simple is a static duration delay while random will choose a latency up to the value provided in the configuration.
  • Supports matching body, method, and headers to serve up a response

Getting Started

Building

make build 

Running

Create a config.yml in the conf directory
server:
  port: 8450

matchers:
  - request:
      method: Get 
      path: /hello/world
      headers:
        ExampleHeaderToMatch: "Example"
    response:
     body: 'hello!'
     statusCode: 200
     headers:
       Content-Type: "text/plain; charset=utf-8"
Run
make run  
 
OR 

./bin/canner-{os} 

TODO / Coming Soon:

  • Support for config file location other than co-located conf/config.yml
  • Support for sample config generation based on a URL
  • Support for request/response capture

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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