Go interfaces
An interface defines a set of method signatures that a type must provide to satisfy it. Go uses implicit satisfaction, so a type implements an interface automatically when its method set contains all the required methods.
Minimal example
type Limiter interface {
Allow(key string) bool
}
type AlwaysAllow struct{}
func (AlwaysAllow) Allow(key string) bool {
return true
}