| "veyron/services/mgmt/repository" |
| // dispatcher holds the state of the profile repository dispatcher. |
| // NewDispatcher is the dispatcher factory. |
| func NewDispatcher(name string, authorizer security.Authorizer) (*dispatcher, error) { |
| store, err := vstore.New(name) |
| return &dispatcher{store: store, auth: authorizer}, nil |
| // DISPATCHER INTERFACE IMPLEMENTATION |
| func (d *dispatcher) Lookup(suffix string) (ipc.Invoker, security.Authorizer, error) { |
| invoker := ipc.ReflectInvoker(repository.NewServerProfile(NewInvoker(d.store, suffix))) |
| return invoker, d.auth, nil |