Nap is a file-based framework for automating the execution of config-driven HTTP requests and scripts.

Nap

Nap is a file-based framework for automating the execution of config-driven HTTP requests and scripts.

Installation Options

Using go get

$ go install github.com/davesheldon/nap@latest

Building the Source

$ git clone https://github.com/davesheldon/nap.git
$ cd nap
$ go install nap

Create a Request

$ nap create request my-request.yml
Created new request stub: my-request.yml

Creates a file like the following:

name: my-request
path: https://cat-fact.herokuapp.com/facts/
verb: GET
type: request
body: ""
headers: {}
prerequestscript: "" # not yet supported
postrequestscript: "" # not yet supported

Run a Request

$ nap run my-request.yml
- my-request.yml: 200 OK

Create a Configuration File

$ nap create config my-config.yml
Created new configuration file stub: my-config.yml

Creates an empty yml file.

Variables

my-request.yml:

name: my-request
path: ${baseurl}/facts/
verb: GET
type: request
body: ""
headers: {}
prerequestscript: ""
postrequestscript: ""

my-config.yml:

baseurl: https://cat-fact.herokuapp.com

Executing:

$ nap run my-request.yml -c my-config.yml
- my-request.yml: 200 OK

Verbose Mode

$ nap run my-request.yml -v
Target File Name: my-request.yml
Config File Name: 
Verbose Mode: true
- my-request.yml:

Running: my-request
Path: https://cat-fact.herokuapp.com/facts/
Verb: GET
Response Status: 200 OK (Content Length: 1859 bytes)
[
    {
        "status": {
            "verified": true,
            "sentCount": 1
        },
        "_id": "58e008800aac31001185ed07",
        "user": "58e007480aac31001185ecef",
        "text": "Wikipedia has a recording of a cat meowing, because why not?", 
        "__v": 0,
        "source": "user",
        "updatedAt": "2020-08-23T20:20:01.611Z",
        "type": "cat",
        "createdAt": "2018-03-06T21:20:03.505Z",
        "deleted": false,
        "used": false
    },
    ...
]
Comments
  • Basic Output

    Basic Output

    Basic output should be able to just show one pass/fail for an entire run op. If there's an error it should output the error as well. If a script is explicitly logging something, it should only show in the verbose log for now.

  • Feature/core v1

    Feature/core v1

    • a bunch of bugfixes
    • basic terminal output
    • nap.fail script wireup
    • fast failures (short-circuit what's left of a routine)
    • some examples to run to help test/explore the framework
  • Polish Documentation for V1

    Polish Documentation for V1

    • [ ] improved, succinct getting started section for the main README.md.
    • [ ] wiki/docs section for the more verbose explanations
    • [ ] some working examples (bonus, can use them as integration test cases)
  • Verbose Output

    Verbose Output

    Verbose output should be good enough not just for a human to see all the details, but also structured in a way that a UI running in a separate process could ingest the output in order to support functions such as:

    • [ ] showing a running console output (from js and network activity alike)
    • [ ] showing environment variables / mutations that happen along the way
    • [ ] obviously success/fail per item in a routine/subroutine
    • [ ] raw response content
    • [ ] maybe more!
  • Finish Core V1 Engine

    Finish Core V1 Engine

    What's left:

    • [x] scripts: expose request/response data in post-request scripts (request method, body, headers, host, path, etc. + response status, body, headers, etc.)
    • [ ] requests: support for multipart/form-data and file attachments
    • [ ] lots of testing/bug fixing
Related tags
Full-featured, plugin-driven, extensible HTTP client toolkit for Go

gentleman Full-featured, plugin-driven, middleware-oriented toolkit to easily create rich, versatile and composable HTTP clients in Go. gentleman embr

Dec 23, 2022
A Go HTTP client library for creating and sending API requests
A Go HTTP client library for creating and sending API requests

Sling Sling is a Go HTTP client library for creating and sending API requests. Slings store HTTP Request properties to simplify sending requests and d

Jan 7, 2023
Replacement of ApacheBench(ab), support for transactional requests, support for command line and package references to HTTP stress testing tool.

stress stress is an HTTP stress testing tool. Through this tool, you can do a stress test on the HTTP service and get detailed test results. It is ins

Aug 23, 2022
httpreq is an http request library written with Golang to make requests and handle responses easily.

httpreq is an http request library written with Golang to make requests and handle responses easily. Install go get github.com/binalyze/http

Feb 10, 2022
A golang tool which makes http requests and prints the address of the request along with the MD5 hash of the response.

Golang Tool This repository is a golang tool which makes http requests to the external server and prints the address of the request along with the MD5

Oct 17, 2021
Gourl: Performs (multiple) HTTP requests and gathers stats

Gourl: Performs (multiple) HTTP requests and gathers stats

Mar 9, 2022
go http api to handle phishing resources requests

go http api to handle phishing resources requests (auth check, prometheus metrics, pushing to rabbit, logging to elasticsearch)

Oct 8, 2021
This project aims for printing HTTP requests from outside simply

HTTP Debug Server This project aims for printing HTTP requests from outside simp

Jan 29, 2022
Retry a function execution with specific intervals with panic recovery

Retry Retry a function execution with specific intervals with panic recovery Make sure to read the docs to understand how this package works and what

Jun 8, 2020
A Go "clone" of the great and famous Requests library

GRequests A Go "clone" of the great and famous Requests library License GRequests is licensed under the Apache License, Version 2.0. See LICENSE for t

Dec 23, 2022
Goget will send a http request, and show the request time, status, response, and save response to a file

Goget will send a http request, and show the request time, status, response, and save response to a file

Feb 9, 2022
Go Supertest is minimalize HTTP Client Testing only for Gin Framework

Go Supertest is minimalize HTTP Client Testing only for Gin Framework, inspired by Supertest package library HTTP Client Testing for Express.js Framework.

May 22, 2022
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http

fasthttp Fast HTTP implementation for Go. Currently fasthttp is successfully used by VertaMedia in a production serving up to 200K rps from more than

Jan 2, 2023
Speak HTTP like a local. (the simple, intuitive HTTP console, golang version)

http-gonsole This is the Go port of the http-console. Speak HTTP like a local Talking to an HTTP server with curl can be fun, but most of the time it'

Jul 14, 2021
Http client call for golang http api calls

httpclient-call-go This library is used to make http calls to different API services Install Package go get

Oct 7, 2022
fhttp is a fork of net/http that provides an array of features pertaining to the fingerprint of the golang http client.

fhttp The f stands for flex. fhttp is a fork of net/http that provides an array of features pertaining to the fingerprint of the golang http client. T

Jan 1, 2023
NATS HTTP Round Tripper - This is a Golang http.RoundTripper that uses NATS as a transport.

This is a Golang http.RoundTripper that uses NATS as a transport. Included is a http.RoundTripper for clients, a server that uses normal HTTP Handlers and any existing http handler mux and a Caddy Server transport.

Dec 6, 2022
Simple HTTP package that wraps net/http

Simple HTTP package that wraps net/http

Jan 17, 2022
Http-conection - A simple example of how to establish a HTTP connection using Golang

A simple example of how to establish a HTTP connection using Golang

Feb 1, 2022