1
0
Fork 0

Throttler mock

This commit is contained in:
Gregory Eremin 2015-02-11 01:23:58 +07:00
parent cc75f8cbac
commit 67ce0913fb
2 changed files with 29 additions and 0 deletions

20
impl/impl.go Normal file
View File

@ -0,0 +1,20 @@
package impl
type (
Impl struct {
Call func([]byte) ([]byte, error)
}
)
func (i *Impl) Units() []string {
return []string{}
}
func New(name string) *Impl {
switch name {
case "units.throttler.Throttler":
return Throttler()
default:
return nil
}
}

9
impl/throttler.go Normal file
View File

@ -0,0 +1,9 @@
package impl
func Throttler() *Impl {
return &Impl{
Call: func(data []byte) (resp []byte, err error) {
return data, nil
},
}
}