Jiri Simsa | 5293dcb | 2014-05-10 09:56:38 -0700 | [diff] [blame] | 1 | package lib |
| 2 | |
| 3 | import ( |
| 4 | "veyron2/ipc" |
| 5 | "veyron2/security" |
| 6 | ) |
| 7 | |
| 8 | // dispatcher holds the invoker and the authorizer to be used for lookup. |
| 9 | type dispatcher struct { |
| 10 | invoker ipc.Invoker |
| 11 | authorizer security.Authorizer |
| 12 | } |
| 13 | |
| 14 | // newDispatcher is a dispatcher factory. |
| 15 | func newDispatcher(invoker ipc.Invoker, authorizer security.Authorizer) *dispatcher { |
| 16 | return &dispatcher{invoker, authorizer} |
| 17 | } |
| 18 | |
| 19 | // Lookup implements dispatcher interface Lookup. |
| 20 | func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) { |
| 21 | return d.invoker, d.authorizer, nil |
| 22 | } |
| 23 | |
| 24 | // StopServing implements dispatcher StopServing. |
| 25 | func (*dispatcher) StopServing() { |
| 26 | } |