
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
go.source.hueristiq.com/http
hq-go-http
is a Go (Golang) package for robust and flexible HTTP communication. It offers advanced features such as configurable retry policies, fallback to HTTP/2, custom hooks for request/response/error handling, and fluent request building with connection management.
OnRequest
)OnResponse
)OnError
)RequestBuilder
to construct and send HTTP requests in a clear and concise manner.ClientConfiguration
.To install the package, run the following command in your terminal:
go get -v -u go.source.hueristiq.com/http
This command will download and install the hq-go-http
package into your Go workspace, making it available for use in your projects.
Here's a simple example demonstrating how to use hq-go-http
:
package main
import (
"log"
hqgohttp "go.source.hueristiq.com/http"
)
func main() {
client := hqgohttp.NewClient(&hqgohttp.ClientConfiguration{
RetryMax: 3, // Max number of retries
Timeout: 10 * time.Second, // Request timeout
RetryWaitMin: 1 * time.Second, // Minimum wait between retries
RetryWaitMax: 5 * time.Second, // Maximum wait between retries
})
response, err := client.Request().Method("GET").URL("https://example.com").Send()
if err != nil {
log.Fatalf("Request failed: %v", err)
}
defer response.Body.Close()
// Handle response here
}
Feel free to submit Pull Requests or report Issues. For more details, check out the contribution guidelines.
Huge thanks to the contributors thus far!
This package is licensed under the MIT license. You are free to use, modify, and distribute it, as long as you follow the terms of the license. You can find the full license text in the repository - Full MIT license text.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.