cliwaremiddlewares

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2018 License: MIT Imports: 0 Imported by: 0

README

Cliware middlewares

Go Report Card Build Status codecov status GoDoc

This repository contains some useful middlewares for Cliware library.

Install

Run go get github.com/delicb/cliware-middlewares in terminal.

Usage

Cliware middlewares are set of tools that can be used to create useful HTTP clients. On there own they do not do much, but to see how they they can be used to put together cool HTTP client, take a loko at GWC (HTTP client built on top of Cliware and Cliware-middlewares).

Content

Middlewares are separated per packages that can be useful on their own. This is done to avoid dependencies between middlewars and create cleaner naming schema. Currently following packages exist:

  • auth - authentication via header support
  • body - handling request body, support setting JSON, XML, string and from io.Reader
  • cookies - handling request cookies (add, set, delete)
  • errors - handling HTTP error status codes and converting them to GoLang errors
  • headers - handling request headers (add, set, delete)
  • query - handling request query parameters (add, set, delete)
  • responsebody - managing respones body, get json, string or write raw content to own writer
  • retry - request retry mechanism based on custom classifier and with custom backoff
  • url - handling URL endpoint for request (base URL, path)

Contribution

Any contribution is welcome. If you find this code useful, please let me know. If you find bugs - feel free to open an issue, or, even better, new pull request.

Credits

Idea and bunch of implementation details were taken from cool GoLang HTTP client Gentleman. Difference is that these middewares are based on Cliware, instead of Gentleman builtin plugin mechanism.

Some ideas for retry middlewares are from go-resiliency project.

Licence

Cliware-middlewares is released under MIT licence.

Documentation

Overview

Package cliwaremiddlewares does not contain any code on its own. All useful code is in sub-packages. This is only container.

Directories

Path Synopsis
Package auth contains middlewares for managing authentication during HTTP request.
Package auth contains middlewares for managing authentication during HTTP request.
Package body contains middlewares for manipulating body of a request.
Package body contains middlewares for manipulating body of a request.
Package cookies contains middlewares for manipulating cookies on request.
Package cookies contains middlewares for manipulating cookies on request.
Package errors contains middlewares for converting HTTP response codes to GoLang errors.
Package errors contains middlewares for converting HTTP response codes to GoLang errors.
Package headers contains middlewares for manipulating headers on request.
Package headers contains middlewares for manipulating headers on request.
Package query contains middlewares for manipulating query string on request.
Package query contains middlewares for manipulating query string on request.
Package responsebody contains middlewares for reading body of HTTP response in different ways.
Package responsebody contains middlewares for reading body of HTTP response in different ways.
Package retry contains set of cliware middlewares and other utilities used for retry logic.
Package retry contains set of cliware middlewares and other utilities used for retry logic.
Package url contains middlewares for manipulating request endpoint.
Package url contains middlewares for manipulating request endpoint.

Jump to

Keyboard shortcuts

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