2015-02-10 18:23:58 +00:00
|
|
|
package impl
|
|
|
|
|
|
|
|
type (
|
|
|
|
Impl struct {
|
2015-02-10 18:45:13 +00:00
|
|
|
actor func([]byte) ([]byte, error)
|
2015-02-10 18:23:58 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func New(name string) *Impl {
|
|
|
|
switch name {
|
|
|
|
case "units.throttler.Throttler":
|
|
|
|
return Throttler()
|
|
|
|
default:
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
2015-02-10 18:45:13 +00:00
|
|
|
|
|
|
|
func (i *Impl) Call(data []byte) (resp []byte, err error) {
|
|
|
|
return i.actor(data)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *Impl) Units() []string {
|
|
|
|
return []string{}
|
|
|
|
}
|