| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| package discovery |
| |
| import ( |
| "v.io/v23/discovery" |
| "v.io/v23/security/access" |
| ) |
| |
| // Directory is the interface for advertisement directory service. |
| type Directory interface { |
| // Lookup returns the advertisement of the given service instance. |
| // |
| // The returned advertisement may not include all attachments. |
| Lookup(id discovery.AdId) (AdInfo | error) {access.Read} |
| |
| // GetAttachment returns the named attachment. Accessing non-existent attachment |
| // is not an error - nil data is returned if not found. |
| // |
| // TODO(jhahn): Consider to return an error if not found. |
| GetAttachment(id discovery.AdId, name string) ([]byte | error) {access.Read} |
| } |