Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 1 | // Package repository contains implementation of the interface for |
| 2 | // storing and serving various veyron management objects. |
| 3 | package repository |
| 4 | |
| 5 | import ( |
Jiri Simsa | 764efb7 | 2014-12-25 20:57:03 -0800 | [diff] [blame] | 6 | "v.io/core/veyron/services/mgmt/profile" |
| 7 | "v.io/core/veyron2/services/mgmt/application" |
| 8 | "v.io/core/veyron2/services/security/access" |
| 9 | public "v.io/core/veyron2/services/mgmt/repository" |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 10 | ) |
| 11 | |
| 12 | // Application describes an application repository internally. Besides |
| 13 | // the public Application interface, it allows to add and remove |
| 14 | // application envelopes. |
| 15 | type Application interface { |
| 16 | public.Application |
| 17 | // Put adds the given tuple of application version (specified |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 18 | // through the object name suffix) and application envelope to all |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 19 | // of the given application profiles. |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 20 | Put(Profiles []string, Envelope application.Envelope) error {access.Write} |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 21 | // Remove removes the application envelope for the given profile |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 22 | // name and application version (specified through the object name |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 23 | // suffix). If no version is specified as part of the suffix, the |
| 24 | // method removes all versions for the given profile. |
| 25 | // |
| 26 | // TODO(jsimsa): Add support for using "*" to specify all profiles |
| 27 | // when Matt implements Globing (or Ken implements querying). |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 28 | Remove(Profile string) error {access.Write} |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | // Profile describes a profile internally. Besides the public Profile |
| 32 | // interface, it allows to add and remove profile specifications. |
| 33 | type Profile interface { |
| 34 | public.Profile |
| 35 | // Specification returns the profile specification for the profile |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 36 | // identified through the object name suffix. |
Todd Wang | 383e88c | 2014-12-18 01:52:34 -0800 | [diff] [blame] | 37 | Specification() (profile.Specification | error) {access.Read} |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 38 | // Put sets the profile specification for the profile identified |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 39 | // through the object name suffix. |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 40 | Put(Specification profile.Specification) error {access.Write} |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 41 | // Remove removes the profile specification for the profile |
Bogdan Caprita | d9281a3 | 2014-07-02 14:40:39 -0700 | [diff] [blame] | 42 | // identified through the object name suffix. |
Asim Shankar | 6888519 | 2014-11-26 12:48:35 -0800 | [diff] [blame] | 43 | Remove() error {access.Write} |
Jiri Simsa | ddbfebb | 2014-06-20 15:56:06 -0700 | [diff] [blame] | 44 | } |