Skip to content

delicb/cliware-middlewares

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Set of middlewares for HTTP clients based on cliware library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages