15 lines
362 B
Go
15 lines
362 B
Go
package admission
|
|
|
|
import "context"
|
|
|
|
// AllowAll validates the common admission contract without applying another
|
|
// quota. It is used when an outer transport boundary already owns rate limits.
|
|
type AllowAll struct{}
|
|
|
|
func (AllowAll) Admit(ctx context.Context, key string) error {
|
|
if ctx == nil || key == "" {
|
|
return ErrInvalidIdentity
|
|
}
|
|
return ctx.Err()
|
|
}
|