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