Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 9.6% dependent packages on proxy.golang.org
Top 3.5% dependent repos on proxy.golang.org

proxy.golang.org : github.com/arielsrv/golang-toolkit/rest

Package rest is an extremely simple to use, lightweight, yet powerful REST Client. The Go http standard library is a great library, but it might sometimes be a bit too low level to use, and it doesn't offer features like fork-join requests for better performance, response caching based on headers, and the possibility to mockup responses. v0.1 v0.2 v0.3 v0.4 v0.5 Caching is done by two strategies working together: Time To Live (TTL) and Least Recently Used (LRU). Objects are inserted in the cache based on Response Headers. You can establish a maximum Memory Size for the cache and objects are flushed based on time expiration (TTL) or by hitting the maximum memory limit. In the last case, least accessed objects will be removed first. Installation Importing Simple GET Simple POST Simple POST, with Struct Body ForkJoin let you **fork** requests, and **wait** until all of them have return. Concurrent has methods for Get, Post, Put, Patch, Delete, Head & Options, with the almost the same API as the synchronous methods. The difference is that these methods return a FutureResponse, which holds a pointer to Response. Response inside FutureResponse is nil until request has finished. Async let you make Restful requests in an **asynchronous** way, without blocking the go routine calling the Async function. Whenever the Response is ready, the **f** function will be called back. Defaults * Headers: keep-alive, Cache-Control: no-cache * Timeout: 2 seconds * ContentType: JSON (for body requests in POST, PUT and PATCH) * Cache: enable * Cache Size: 1GB * Idle Connections Per Host: 2 (the default of http.net package) * HTTP/2: automatic with Go 1.6 * Gzip: automatic support for gzip responses RequestBuilder gives you the power to go beyond defaults. It is possible to set up headers, timeout, baseURL, proxy, contentType, not to use cache, directly disabling timeout (in an explicit way), and setting max idle connections. When using mockups, all requests will be sent to the mockup server. To activate the mockup *environment* you have two ways: using the flag -mock Or by programmatically starting the mockup server An example

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/arielsrv/golang-toolkit/rest
Keywords: connection-pool, fast, generics, go, golang, http, http-client, restclient, restful, toolkit, transport
License: Apache-2.0
Latest release: over 1 year ago
First release: over 1 year ago
Namespace: github.com/arielsrv/golang-toolkit
Dependent packages: 1
Dependent repositories: 2
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 15 days ago

    Loading...
    Readme
    Loading...