blob: b1d5d4fdaafb5e75597c59c883e705c65c526047 [file] [log] [blame]
Adam Sadovskyf3b7abc2015-05-04 15:33:22 -07001// 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 Sadovskybc00bd62015-05-22 12:50:03 -07005package interfaces
Adam Sadovskyf3b7abc2015-05-04 15:33:22 -07006
7import (
8 "v.io/v23/context"
9 "v.io/v23/rpc"
10 "v.io/v23/security/access"
11)
12
Adam Sadovskybc00bd62015-05-22 12:50:03 -070013// App is an internal interface to the app layer.
Adam Sadovskyf3b7abc2015-05-04 15:33:22 -070014type App interface {
Himabindu Puchaf9ec56f2015-06-02 11:34:05 -070015 // Service returns the service handle for this app.
16 Service() Service
17
Adam Sadovskyf3b7abc2015-05-04 15:33:22 -070018 // NoSQLDatabase returns the Database for the specified NoSQL database.
19 NoSQLDatabase(ctx *context.T, call rpc.ServerCall, dbName string) (Database, error)
20
Raja Daouda9cfe5e2015-05-28 14:38:34 -070021 // NoSQLDatabaseNames returns the names of the NoSQL databases within the App.
22 NoSQLDatabaseNames(ctx *context.T, call rpc.ServerCall) ([]string, error)
23
Adam Sadovskyf3b7abc2015-05-04 15:33:22 -070024 // 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 Puchaf9ec56f2015-06-02 11:34:05 -070032
Adam Sadovskya31a7cd2015-07-08 10:44:07 -070033 // Name returns the name of this app.
34 Name() string
Adam Sadovskyf3b7abc2015-05-04 15:33:22 -070035}