| // 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 repository augments the v.io/v23/services/repository interfaces with |
| // implementation-specific configuration methods. |
| package repository |
| |
| import ( |
| "v.io/v23/security/access" |
| "v.io/v23/services/application" |
| "v.io/x/ref/services/profile" |
| public "v.io/v23/services/repository" |
| ) |
| |
| // Application describes an application repository internally. Besides the |
| // public Application interface, it allows adding and removing application |
| // envelopes, as well as querying for a list of supported profiles. |
| type Application interface { |
| public.Application |
| // Put adds the given application envelope for the given profile and |
| // application version (required, and specified through the object name |
| // suffix). |
| // |
| // An error is returned if an envelope already exists, unless the |
| // overwrite option is set. |
| Put(Profile string, Envelope application.Envelope, Overwrite bool) error {access.Write} |
| // Remove removes the application envelope for the given profile |
| // name and application version (specified through the object name |
| // suffix). |
| // |
| // If no version is specified as part of the suffix, the method removes |
| // all versions for the given profile. |
| // |
| // If the profile is the string "*", all profiles are removed for the |
| // given version (or for all versions if the version is not specified). |
| Remove(Profile string) error {access.Write} |
| // Profiles returns the supported profiles for the application version |
| // specified through the object name suffix. If the version is not |
| // specified, Profiles returns the union of profiles across all |
| // versions. |
| Profiles() ([]string | error) {access.Read} |
| } |
| |
| // Profile describes a profile internally. Besides the public Profile |
| // interface, it allows to add and remove profile specifications. |
| type Profile interface { |
| public.Profile |
| // Specification returns the profile specification for the profile |
| // identified through the object name suffix. |
| Specification() (profile.Specification | error) {access.Read} |
| // Put sets the profile specification for the profile identified |
| // through the object name suffix. |
| Put(Specification profile.Specification) error {access.Write} |
| // Remove removes the profile specification for the profile |
| // identified through the object name suffix. |
| Remove() error {access.Write} |
| } |