Adam Sadovsky | f3b7abc | 2015-05-04 15:33:22 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Vanadium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
Adam Sadovsky | bc00bd6 | 2015-05-22 12:50:03 -0700 | [diff] [blame] | 5 | package interfaces |
Adam Sadovsky | f3b7abc | 2015-05-04 15:33:22 -0700 | [diff] [blame] | 6 | |
| 7 | import ( |
| 8 | "v.io/v23/context" |
| 9 | "v.io/v23/rpc" |
| 10 | "v.io/v23/security/access" |
| 11 | ) |
| 12 | |
Adam Sadovsky | bc00bd6 | 2015-05-22 12:50:03 -0700 | [diff] [blame] | 13 | // App is an internal interface to the app layer. |
Adam Sadovsky | f3b7abc | 2015-05-04 15:33:22 -0700 | [diff] [blame] | 14 | type App interface { |
Himabindu Pucha | f9ec56f | 2015-06-02 11:34:05 -0700 | [diff] [blame] | 15 | // Service returns the service handle for this app. |
| 16 | Service() Service |
| 17 | |
Adam Sadovsky | f3b7abc | 2015-05-04 15:33:22 -0700 | [diff] [blame] | 18 | // NoSQLDatabase returns the Database for the specified NoSQL database. |
| 19 | NoSQLDatabase(ctx *context.T, call rpc.ServerCall, dbName string) (Database, error) |
| 20 | |
Raja Daoud | a9cfe5e | 2015-05-28 14:38:34 -0700 | [diff] [blame] | 21 | // NoSQLDatabaseNames returns the names of the NoSQL databases within the App. |
| 22 | NoSQLDatabaseNames(ctx *context.T, call rpc.ServerCall) ([]string, error) |
| 23 | |
Adam Sadovsky | f3b7abc | 2015-05-04 15:33:22 -0700 | [diff] [blame] | 24 | // CreateNoSQLDatabase creates the specified NoSQL database. |
| 25 | CreateNoSQLDatabase(ctx *context.T, call rpc.ServerCall, dbName string, perms access.Permissions) error |
| 26 | |
| 27 | // DeleteNoSQLDatabase deletes the specified NoSQL database. |
| 28 | DeleteNoSQLDatabase(ctx *context.T, call rpc.ServerCall, dbName string) error |
| 29 | |
| 30 | // SetDatabasePerms sets the perms for the specified database. |
| 31 | SetDatabasePerms(ctx *context.T, call rpc.ServerCall, dbName string, perms access.Permissions, version string) error |
Himabindu Pucha | f9ec56f | 2015-06-02 11:34:05 -0700 | [diff] [blame] | 32 | |
Adam Sadovsky | a31a7cd | 2015-07-08 10:44:07 -0700 | [diff] [blame] | 33 | // Name returns the name of this app. |
| 34 | Name() string |
Adam Sadovsky | f3b7abc | 2015-05-04 15:33:22 -0700 | [diff] [blame] | 35 | } |