forked from vanadium-archive/go.v23
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.go
35 lines (28 loc) · 1011 Bytes
/
schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// 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
import (
"v.io/v23/context"
wire "v.io/v23/services/syncbase"
)
//////////////////////////////////////////
// Implementation of SchemaManager (Not part of public client API)
type schemaManagerImpl struct {
c wire.DatabaseClientMethods
}
func newSchemaManager(client wire.DatabaseClientMethods) schemaManagerImpl {
return schemaManagerImpl{
c: client,
}
}
// GetSchemaMetadata retrieves the schema metadata for the database it is
// derived from.
func (sm *schemaManagerImpl) getSchemaMetadata(ctx *context.T) (wire.SchemaMetadata, error) {
return sm.c.GetSchemaMetadata(ctx)
}
// SetSchemaMetadata stores the schema metadata for the database it is
// derived from.
func (sm *schemaManagerImpl) setSchemaMetadata(ctx *context.T, metadata wire.SchemaMetadata) error {
return sm.c.SetSchemaMetadata(ctx, metadata)
}