github.com/go-graphite/carbonapi@v0.17.0/limiter/noop.go (about)

     1  package limiter
     2  
     3  import (
     4  	"context"
     5  )
     6  
     7  // ServerLimiter provides interface to limit amount of requests
     8  type NoopLimiter struct {
     9  }
    10  
    11  func (l NoopLimiter) Capacity() int {
    12  	return 0
    13  }
    14  
    15  // Enter claims one of free slots or blocks until there is one.
    16  func (l NoopLimiter) Enter(ctx context.Context, s string) error {
    17  	return nil
    18  }
    19  
    20  // Frees a slot in limiter
    21  func (l NoopLimiter) Leave(ctx context.Context, s string) {
    22  }