Skip to content

Commit

Permalink
chore: remove rate limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
sekiju committed Mar 16, 2024
1 parent 395d070 commit f525cc7
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 156 deletions.
4 changes: 0 additions & 4 deletions get.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ func Get(url string, opts ...OptsFn) (*Response, error) {
fn(&cfg)
}

if cfg.RateLimiter != nil {
cfg.RateLimiter.Wait()
}

req, err := newRequest("GET", url, nil, cfg)
if err != nil {
return nil, err
Expand Down
11 changes: 2 additions & 9 deletions options.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package rq

type Opts struct {
Headers map[string]string
Body interface{}
RateLimiter *RateLimiter
Headers map[string]string
Body interface{}
}

type OptsFn func(*Opts)
Expand All @@ -23,9 +22,3 @@ func SetBody(v interface{}) OptsFn {
o.Body = v
}
}

func SetRateLimiter(rateLimiter *RateLimiter) OptsFn {
return func(o *Opts) {
o.RateLimiter = rateLimiter
}
}
4 changes: 0 additions & 4 deletions post.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ func (postMethod) JSON(url string, opts ...OptsFn) (*Response, error) {
fn(&cfg)
}

if cfg.RateLimiter != nil {
cfg.RateLimiter.Wait()
}

serialized, err := json.Marshal(cfg.Body)
if err != nil {
return nil, err
Expand Down
99 changes: 0 additions & 99 deletions ratelimiter.go

This file was deleted.

40 changes: 0 additions & 40 deletions ratelimiter_test.go

This file was deleted.

0 comments on commit f525cc7

Please sign in to comment.