forked from vanadium-archive/go.ref
/
cluster.vdl.go
292 lines (251 loc) · 10.2 KB
/
cluster.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
// 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: cluster
package cluster
import (
"v.io/v23"
"v.io/v23/context"
"v.io/v23/rpc"
"v.io/v23/security"
"v.io/v23/security/access"
"v.io/v23/vdl"
)
var _ = __VDLInit() // Must be first; see __VDLInit comments for details.
//////////////////////////////////////////////////
// Interface definitions
// ClusterAgentClientMethods is the client interface
// containing ClusterAgent methods.
type ClusterAgentClientMethods interface {
// Retrieves all the blessings associated with a particular secret.
// The only authorization required to access this method is the secret
// itself.
// TODO(rthellend): Consider adding other side-channel authorization
// mechanisms, e.g. verify that the IP address of the client belongs to
// an authorized user.
SeekBlessings(_ *context.T, secret string, _ ...rpc.CallOpt) (security.Blessings, error)
}
// ClusterAgentClientStub adds universal methods to ClusterAgentClientMethods.
type ClusterAgentClientStub interface {
ClusterAgentClientMethods
rpc.UniversalServiceMethods
}
// ClusterAgentClient returns a client stub for ClusterAgent.
func ClusterAgentClient(name string) ClusterAgentClientStub {
return implClusterAgentClientStub{name}
}
type implClusterAgentClientStub struct {
name string
}
func (c implClusterAgentClientStub) SeekBlessings(ctx *context.T, i0 string, opts ...rpc.CallOpt) (o0 security.Blessings, err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "SeekBlessings", []interface{}{i0}, []interface{}{&o0}, opts...)
return
}
// ClusterAgentServerMethods is the interface a server writer
// implements for ClusterAgent.
type ClusterAgentServerMethods interface {
// Retrieves all the blessings associated with a particular secret.
// The only authorization required to access this method is the secret
// itself.
// TODO(rthellend): Consider adding other side-channel authorization
// mechanisms, e.g. verify that the IP address of the client belongs to
// an authorized user.
SeekBlessings(_ *context.T, _ rpc.ServerCall, secret string) (security.Blessings, error)
}
// ClusterAgentServerStubMethods is the server interface containing
// ClusterAgent methods, as expected by rpc.Server.
// There is no difference between this interface and ClusterAgentServerMethods
// since there are no streaming methods.
type ClusterAgentServerStubMethods ClusterAgentServerMethods
// ClusterAgentServerStub adds universal methods to ClusterAgentServerStubMethods.
type ClusterAgentServerStub interface {
ClusterAgentServerStubMethods
// Describe the ClusterAgent interfaces.
Describe__() []rpc.InterfaceDesc
}
// ClusterAgentServer returns a server stub for ClusterAgent.
// It converts an implementation of ClusterAgentServerMethods into
// an object that may be used by rpc.Server.
func ClusterAgentServer(impl ClusterAgentServerMethods) ClusterAgentServerStub {
stub := implClusterAgentServerStub{
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 implClusterAgentServerStub struct {
impl ClusterAgentServerMethods
gs *rpc.GlobState
}
func (s implClusterAgentServerStub) SeekBlessings(ctx *context.T, call rpc.ServerCall, i0 string) (security.Blessings, error) {
return s.impl.SeekBlessings(ctx, call, i0)
}
func (s implClusterAgentServerStub) Globber() *rpc.GlobState {
return s.gs
}
func (s implClusterAgentServerStub) Describe__() []rpc.InterfaceDesc {
return []rpc.InterfaceDesc{ClusterAgentDesc}
}
// ClusterAgentDesc describes the ClusterAgent interface.
var ClusterAgentDesc rpc.InterfaceDesc = descClusterAgent
// descClusterAgent hides the desc to keep godoc clean.
var descClusterAgent = rpc.InterfaceDesc{
Name: "ClusterAgent",
PkgPath: "v.io/x/ref/services/cluster",
Methods: []rpc.MethodDesc{
{
Name: "SeekBlessings",
Doc: "// Retrieves all the blessings associated with a particular secret.\n// The only authorization required to access this method is the secret\n// itself.\n// TODO(rthellend): Consider adding other side-channel authorization\n// mechanisms, e.g. verify that the IP address of the client belongs to\n// an authorized user.",
InArgs: []rpc.ArgDesc{
{"secret", ``}, // string
},
OutArgs: []rpc.ArgDesc{
{"", ``}, // security.Blessings
},
},
},
}
// ClusterAgentAdminClientMethods is the client interface
// containing ClusterAgentAdmin methods.
type ClusterAgentAdminClientMethods interface {
ClusterAgentClientMethods
// Creates a new "secret" that can be used to retrieve extensions
// of the blessings granted on this RPC, e.g. with the rpc.Granter
// ClientCallOpt in Go.
NewSecret(*context.T, ...rpc.CallOpt) (secret string, _ error)
// Forgets a secret and its associated blessings.
ForgetSecret(_ *context.T, secret string, _ ...rpc.CallOpt) error
}
// ClusterAgentAdminClientStub adds universal methods to ClusterAgentAdminClientMethods.
type ClusterAgentAdminClientStub interface {
ClusterAgentAdminClientMethods
rpc.UniversalServiceMethods
}
// ClusterAgentAdminClient returns a client stub for ClusterAgentAdmin.
func ClusterAgentAdminClient(name string) ClusterAgentAdminClientStub {
return implClusterAgentAdminClientStub{name, ClusterAgentClient(name)}
}
type implClusterAgentAdminClientStub struct {
name string
ClusterAgentClientStub
}
func (c implClusterAgentAdminClientStub) NewSecret(ctx *context.T, opts ...rpc.CallOpt) (o0 string, err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "NewSecret", nil, []interface{}{&o0}, opts...)
return
}
func (c implClusterAgentAdminClientStub) ForgetSecret(ctx *context.T, i0 string, opts ...rpc.CallOpt) (err error) {
err = v23.GetClient(ctx).Call(ctx, c.name, "ForgetSecret", []interface{}{i0}, nil, opts...)
return
}
// ClusterAgentAdminServerMethods is the interface a server writer
// implements for ClusterAgentAdmin.
type ClusterAgentAdminServerMethods interface {
ClusterAgentServerMethods
// Creates a new "secret" that can be used to retrieve extensions
// of the blessings granted on this RPC, e.g. with the rpc.Granter
// ClientCallOpt in Go.
NewSecret(*context.T, rpc.ServerCall) (secret string, _ error)
// Forgets a secret and its associated blessings.
ForgetSecret(_ *context.T, _ rpc.ServerCall, secret string) error
}
// ClusterAgentAdminServerStubMethods is the server interface containing
// ClusterAgentAdmin methods, as expected by rpc.Server.
// There is no difference between this interface and ClusterAgentAdminServerMethods
// since there are no streaming methods.
type ClusterAgentAdminServerStubMethods ClusterAgentAdminServerMethods
// ClusterAgentAdminServerStub adds universal methods to ClusterAgentAdminServerStubMethods.
type ClusterAgentAdminServerStub interface {
ClusterAgentAdminServerStubMethods
// Describe the ClusterAgentAdmin interfaces.
Describe__() []rpc.InterfaceDesc
}
// ClusterAgentAdminServer returns a server stub for ClusterAgentAdmin.
// It converts an implementation of ClusterAgentAdminServerMethods into
// an object that may be used by rpc.Server.
func ClusterAgentAdminServer(impl ClusterAgentAdminServerMethods) ClusterAgentAdminServerStub {
stub := implClusterAgentAdminServerStub{
impl: impl,
ClusterAgentServerStub: ClusterAgentServer(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 implClusterAgentAdminServerStub struct {
impl ClusterAgentAdminServerMethods
ClusterAgentServerStub
gs *rpc.GlobState
}
func (s implClusterAgentAdminServerStub) NewSecret(ctx *context.T, call rpc.ServerCall) (string, error) {
return s.impl.NewSecret(ctx, call)
}
func (s implClusterAgentAdminServerStub) ForgetSecret(ctx *context.T, call rpc.ServerCall, i0 string) error {
return s.impl.ForgetSecret(ctx, call, i0)
}
func (s implClusterAgentAdminServerStub) Globber() *rpc.GlobState {
return s.gs
}
func (s implClusterAgentAdminServerStub) Describe__() []rpc.InterfaceDesc {
return []rpc.InterfaceDesc{ClusterAgentAdminDesc, ClusterAgentDesc}
}
// ClusterAgentAdminDesc describes the ClusterAgentAdmin interface.
var ClusterAgentAdminDesc rpc.InterfaceDesc = descClusterAgentAdmin
// descClusterAgentAdmin hides the desc to keep godoc clean.
var descClusterAgentAdmin = rpc.InterfaceDesc{
Name: "ClusterAgentAdmin",
PkgPath: "v.io/x/ref/services/cluster",
Embeds: []rpc.EmbedDesc{
{"ClusterAgent", "v.io/x/ref/services/cluster", ``},
},
Methods: []rpc.MethodDesc{
{
Name: "NewSecret",
Doc: "// Creates a new \"secret\" that can be used to retrieve extensions\n// of the blessings granted on this RPC, e.g. with the rpc.Granter\n// ClientCallOpt in Go.",
OutArgs: []rpc.ArgDesc{
{"secret", ``}, // string
},
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Admin"))},
},
{
Name: "ForgetSecret",
Doc: "// Forgets a secret and its associated blessings.",
InArgs: []rpc.ArgDesc{
{"secret", ``}, // string
},
Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Admin"))},
},
},
}
var __VDLInitCalled bool
// __VDLInit 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 _ = __VDLInit()
//
// 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 __VDLInit() struct{} {
if __VDLInitCalled {
return struct{}{}
}
__VDLInitCalled = true
return struct{}{}
}