/
mounttablelib.vdl.go
172 lines (147 loc) · 5.87 KB
/
mounttablelib.vdl.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// 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.
// This file was auto-generated by the vanadium vdl tool.
// Package: mounttablelib
//nolint:golint
package mounttablelib
import (
v23 "v.io/v23"
"v.io/v23/context"
"v.io/v23/rpc"
)
var _ = initializeVDL() // Must be first; see initializeVDL comments for details.
// Interface definitions
// =====================
// CollectionClientMethods is the client interface
// containing Collection methods.
type CollectionClientMethods interface {
// Export sets the value for a name. Overwrite controls the behavior when
// an entry exists, if Overwrite is true, then the binding is replaced,
// otherwise the call fails with an error. The Val must be no larger than
// MaxSize bytes.
Export(_ *context.T, Val string, Overwrite bool, _ ...rpc.CallOpt) error
// Lookup retrieves the value associated with a name. Returns an error if
// there is no such binding.
Lookup(*context.T, ...rpc.CallOpt) ([]byte, error)
}
// CollectionClientStub embeds CollectionClientMethods and is a
// placeholder for additional management operations.
type CollectionClientStub interface {
CollectionClientMethods
}
// CollectionClient returns a client stub for Collection.
func CollectionClient(name string) CollectionClientStub {
return implCollectionClientStub{name}
}
type implCollectionClientStub struct {
name string
}
func (c implCollectionClientStub) Export(ctx *context.T, i0 string, i1 bool, opts ...rpc.CallOpt) (err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "Export", []interface{}{i0, i1}, nil, opts...)
return
}
func (c implCollectionClientStub) Lookup(ctx *context.T, opts ...rpc.CallOpt) (o0 []byte, err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "Lookup", nil, []interface{}{&o0}, opts...)
return
}
// CollectionServerMethods is the interface a server writer
// implements for Collection.
type CollectionServerMethods interface {
// Export sets the value for a name. Overwrite controls the behavior when
// an entry exists, if Overwrite is true, then the binding is replaced,
// otherwise the call fails with an error. The Val must be no larger than
// MaxSize bytes.
Export(_ *context.T, _ rpc.ServerCall, Val string, Overwrite bool) error
// Lookup retrieves the value associated with a name. Returns an error if
// there is no such binding.
Lookup(*context.T, rpc.ServerCall) ([]byte, error)
}
// CollectionServerStubMethods is the server interface containing
// Collection methods, as expected by rpc.Server.
// There is no difference between this interface and CollectionServerMethods
// since there are no streaming methods.
type CollectionServerStubMethods CollectionServerMethods
// CollectionServerStub adds universal methods to CollectionServerStubMethods.
type CollectionServerStub interface {
CollectionServerStubMethods
// DescribeInterfaces the Collection interfaces.
Describe__() []rpc.InterfaceDesc
}
// CollectionServer returns a server stub for Collection.
// It converts an implementation of CollectionServerMethods into
// an object that may be used by rpc.Server.
func CollectionServer(impl CollectionServerMethods) CollectionServerStub {
stub := implCollectionServerStub{
impl: impl,
}
// Initialize GlobState; always check the stub itself first, to handle the
// case where the user has the Glob method defined in their VDL source.
if gs := rpc.NewGlobState(stub); gs != nil {
stub.gs = gs
} else if gs := rpc.NewGlobState(impl); gs != nil {
stub.gs = gs
}
return stub
}
type implCollectionServerStub struct {
impl CollectionServerMethods
gs *rpc.GlobState
}
func (s implCollectionServerStub) Export(ctx *context.T, call rpc.ServerCall, i0 string, i1 bool) error {
return s.impl.Export(ctx, call, i0, i1)
}
func (s implCollectionServerStub) Lookup(ctx *context.T, call rpc.ServerCall) ([]byte, error) {
return s.impl.Lookup(ctx, call)
}
func (s implCollectionServerStub) Globber() *rpc.GlobState {
return s.gs
}
func (s implCollectionServerStub) Describe__() []rpc.InterfaceDesc {
return []rpc.InterfaceDesc{CollectionDesc}
}
// CollectionDesc describes the Collection interface.
var CollectionDesc rpc.InterfaceDesc = descCollection
// descCollection hides the desc to keep godoc clean.
var descCollection = rpc.InterfaceDesc{
Name: "Collection",
PkgPath: "v.io/x/ref/services/mounttable/mounttablelib",
Methods: []rpc.MethodDesc{
{
Name: "Export",
Doc: "// Export sets the value for a name. Overwrite controls the behavior when\n// an entry exists, if Overwrite is true, then the binding is replaced,\n// otherwise the call fails with an error. The Val must be no larger than\n// MaxSize bytes.",
InArgs: []rpc.ArgDesc{
{Name: "Val", Doc: ``}, // string
{Name: "Overwrite", Doc: ``}, // bool
},
},
{
Name: "Lookup",
Doc: "// Lookup retrieves the value associated with a name. Returns an error if\n// there is no such binding.",
OutArgs: []rpc.ArgDesc{
{Name: "", Doc: ``}, // []byte
},
},
},
}
var initializeVDLCalled bool
// initializeVDL performs vdl initialization. It is safe to call multiple times.
// If you have an init ordering issue, just insert the following line verbatim
// into your source files in this package, right after the "package foo" clause:
//
// var _ = initializeVDL()
//
// The purpose of this function is to ensure that vdl initialization occurs in
// the right order, and very early in the init sequence. In particular, vdl
// registration and package variable initialization needs to occur before
// functions like vdl.TypeOf will work properly.
//
// This function returns a dummy value, so that it can be used to initialize the
// first var in the file, to take advantage of Go's defined init order.
func initializeVDL() struct{} {
if initializeVDLCalled {
return struct{}{}
}
initializeVDLCalled = true
return struct{}{}
}