blob: 8c53b45f0044a82af2dfb2c8aac9edd2dc0bfb83 [file] [log] [blame]
// This file was auto-generated by the veyron vdl tool.
// Source: discharger.vdl
package security
import (
// VDL system imports
"v.io/v23"
"v.io/v23/context"
"v.io/v23/ipc"
// VDL user imports
"v.io/v23/security"
)
// DischargerClientMethods is the client interface
// containing Discharger methods.
//
// Discharger is the interface for obtaining discharges for ThirdPartyCaveats.
type DischargerClientMethods interface {
// Discharge is called by a principal that holds a blessing with a third
// party caveat and seeks to get a discharge that proves the fulfillment of
// this caveat.
Discharge(ctx *context.T, Caveat security.Caveat, Impetus security.DischargeImpetus, opts ...ipc.CallOpt) (Discharge security.Discharge, err error)
}
// DischargerClientStub adds universal methods to DischargerClientMethods.
type DischargerClientStub interface {
DischargerClientMethods
ipc.UniversalServiceMethods
}
// DischargerClient returns a client stub for Discharger.
func DischargerClient(name string, opts ...ipc.BindOpt) DischargerClientStub {
var client ipc.Client
for _, opt := range opts {
if clientOpt, ok := opt.(ipc.Client); ok {
client = clientOpt
}
}
return implDischargerClientStub{name, client}
}
type implDischargerClientStub struct {
name string
client ipc.Client
}
func (c implDischargerClientStub) c(ctx *context.T) ipc.Client {
if c.client != nil {
return c.client
}
return v23.GetClient(ctx)
}
func (c implDischargerClientStub) Discharge(ctx *context.T, i0 security.Caveat, i1 security.DischargeImpetus, opts ...ipc.CallOpt) (o0 security.Discharge, err error) {
var call ipc.ClientCall
if call, err = c.c(ctx).StartCall(ctx, c.name, "Discharge", []interface{}{i0, i1}, opts...); err != nil {
return
}
err = call.Finish(&o0)
return
}
// DischargerServerMethods is the interface a server writer
// implements for Discharger.
//
// Discharger is the interface for obtaining discharges for ThirdPartyCaveats.
type DischargerServerMethods interface {
// Discharge is called by a principal that holds a blessing with a third
// party caveat and seeks to get a discharge that proves the fulfillment of
// this caveat.
Discharge(call ipc.ServerCall, Caveat security.Caveat, Impetus security.DischargeImpetus) (Discharge security.Discharge, err error)
}
// DischargerServerStubMethods is the server interface containing
// Discharger methods, as expected by ipc.Server.
// There is no difference between this interface and DischargerServerMethods
// since there are no streaming methods.
type DischargerServerStubMethods DischargerServerMethods
// DischargerServerStub adds universal methods to DischargerServerStubMethods.
type DischargerServerStub interface {
DischargerServerStubMethods
// Describe the Discharger interfaces.
Describe__() []ipc.InterfaceDesc
}
// DischargerServer returns a server stub for Discharger.
// It converts an implementation of DischargerServerMethods into
// an object that may be used by ipc.Server.
func DischargerServer(impl DischargerServerMethods) DischargerServerStub {
stub := implDischargerServerStub{
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 := ipc.NewGlobState(stub); gs != nil {
stub.gs = gs
} else if gs := ipc.NewGlobState(impl); gs != nil {
stub.gs = gs
}
return stub
}
type implDischargerServerStub struct {
impl DischargerServerMethods
gs *ipc.GlobState
}
func (s implDischargerServerStub) Discharge(call ipc.ServerCall, i0 security.Caveat, i1 security.DischargeImpetus) (security.Discharge, error) {
return s.impl.Discharge(call, i0, i1)
}
func (s implDischargerServerStub) Globber() *ipc.GlobState {
return s.gs
}
func (s implDischargerServerStub) Describe__() []ipc.InterfaceDesc {
return []ipc.InterfaceDesc{DischargerDesc}
}
// DischargerDesc describes the Discharger interface.
var DischargerDesc ipc.InterfaceDesc = descDischarger
// descDischarger hides the desc to keep godoc clean.
var descDischarger = ipc.InterfaceDesc{
Name: "Discharger",
PkgPath: "v.io/x/ref/services/security",
Doc: "// Discharger is the interface for obtaining discharges for ThirdPartyCaveats.",
Methods: []ipc.MethodDesc{
{
Name: "Discharge",
Doc: "// Discharge is called by a principal that holds a blessing with a third\n// party caveat and seeks to get a discharge that proves the fulfillment of\n// this caveat.",
InArgs: []ipc.ArgDesc{
{"Caveat", ``}, // security.Caveat
{"Impetus", ``}, // security.DischargeImpetus
},
OutArgs: []ipc.ArgDesc{
{"Discharge", ``}, // security.Discharge
},
},
},
}