Coder Social home page Coder Social logo

postfinance / httpclient Goto Github PK

View Code? Open in Web Editor NEW
13.0 9.0 2.0 34 KB

Generates a HTTP client from a service definition (interface). The created client is ready to use in production with many configuration options and sensible defaults.

License: MIT License

Go 100.00%
golang

httpclient's Introduction

Go Report Card GoDoc Build Status Coverage Status

httpclient

Generates a HTTP client from a service definition (interface). The created client is ready to use in production with many configuration options and sensible defaults.

Requirements

Go 1.7

Installation

# go get -u github.com/postfinance/httpclient/cmd/httpclient-gen-go

Usage

See example

httpclient's People

Contributors

ghouscht avatar marcsauter avatar opensourcepf avatar zbindenren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

httpclient's Issues

v2 discussion

Custom Response
Instead of http.Response return a httpclient.Response like:

type struct httpclient.Response {
  *http.Response
  reqDump []byte
  bodyDump []byte
}

This could possibly fix #8 .

It would add the possibility to add a Dump method which dumps request or response.

Debug Option
Add Debug option to dump requests and responses.

Do not export RequestCallback and ResponseCallback
Use an unexported slice of callbacks and append custom callbacks. If we initiate the slice with the default error handler we do not need additional documentation for error handling

Propagate error.

Make options thread-safe
Currently it is possible to change an already initiated client with the functional options. For example it is possible to change the http.client with httpclient.WithHTTPClient

Do not embed Client in struct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.