Skip to content

virgo is a concurrent and tiny HTTP request client.

Notifications You must be signed in to change notification settings

shellrausch/virgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

virgo

virgo is a concurrent and tiny HTTP request client.

Installation

Get the package.

go get github.com/shellrausch/virgo

Usage

Concurrent http requests.

urls := []string{ "https://google.com", "https://example.com", "https://github.com" }
resultCh := make(chan *virgo.Result, 16)

v := virgo.New()
go v.Start(urls, resultCh)

for r := range resultCh {
    if r.Err == nil {
        // do something with the response
    }   
}

Concurrent http request and custom options for all requests.

urls := []string{ "https://google.com", "https://example.com", "https://github.com" }
resultCh := make(chan *virgo.Result, 16)

o := options.New()
o.UserAgent = "VirgoBot"
o.TimeoutMs = 5000
o.Concurrency = 16
o.Method = "POST"
o.Body = []byte("{ key : value }")

v := virgo.New()
v.SetOptions(o)
go v.Start(urls, resultCh)

for r := range resultCh {
    if r.Err == nil {
        // do something with the response
    }
}

About

virgo is a concurrent and tiny HTTP request client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages