| // 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 syncbase defines the wire API for a structured store that supports |
| // peer-to-peer synchronization. |
| // |
| // TODO(sadovsky): Write a detailed package description. |
| package syncbase |
| |
| import ( |
| "v.io/v23/security/access" |
| "v.io/v23/services/permissions" |
| ) |
| |
| // NOTE(sadovsky): Various methods below may end up needing additional options. |
| |
| // Service represents a Vanadium Syncbase service. |
| // Service.Glob operates over App names. |
| type Service interface { |
| // SetPermissions and GetPermissions are included from the Object interface. |
| permissions.Object |
| } |
| |
| // TODO(sadovsky): We may want to allow clients to rename their Apps and |
| // Databases (and Tables, via schema updates). Internally, this means we'd need |
| // to add a layer of indirection, where client-supplied names get translated |
| // into opaque internal identifiers. |
| |
| // App represents the data for a specific app instance (possibly a combination |
| // of user, device, and app). |
| // App.Glob operates over Database names. |
| type App interface { |
| // Create creates this App. |
| // If perms is nil, Permissions is inherited (copied) from the Service. |
| // Create requires the caller to have Write permission at the Service. |
| Create(perms access.Permissions) error {access.Write} |
| |
| // Delete deletes this App. |
| Delete() error {access.Write} |
| |
| // SetPermissions and GetPermissions are included from the Object interface. |
| permissions.Object |
| } |
| |
| error ( |
| InvalidName(name string) {"en": "invalid name: {name}"} |
| ) |