blob: e0f7d09f22f2a3f5eacfce1e86b0f4c81bcf3305 [file] [log] [blame]
// This file was auto-generated by the veyron vdl tool.
// Source: discharger.vdl
package security
import (
// VDL system imports
"v.io/core/veyron2"
"v.io/core/veyron2/context"
"v.io/core/veyron2/ipc"
"v.io/core/veyron2/vdl"
// VDL user imports
"v.io/core/veyron2/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.
//
// TODO(ataly,ashankar): Figure out a VDL representation for Discharge.
// TODO(ataly,ashankar): Type of Caveat should become security.Caveat once
// security.Caveat.ValidatorVOM goes away.
Discharge(ctx *context.T, Caveat vdl.AnyRep, Impetus security.DischargeImpetus, opts ...ipc.CallOpt) (Discharge vdl.AnyRep, 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 veyron2.GetClient(ctx)
}
func (c implDischargerClientStub) Discharge(ctx *context.T, i0 vdl.AnyRep, i1 security.DischargeImpetus, opts ...ipc.CallOpt) (o0 vdl.AnyRep, err error) {
var call ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Discharge", []interface{}{i0, i1}, opts...); err != nil {
return
}
if ierr := call.Finish(&o0, &err); ierr != nil {
err = ierr
}
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.
//
// TODO(ataly,ashankar): Figure out a VDL representation for Discharge.
// TODO(ataly,ashankar): Type of Caveat should become security.Caveat once
// security.Caveat.ValidatorVOM goes away.
Discharge(ctx ipc.ServerContext, Caveat vdl.AnyRep, Impetus security.DischargeImpetus) (Discharge vdl.AnyRep, 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(ctx ipc.ServerContext, i0 vdl.AnyRep, i1 security.DischargeImpetus) (vdl.AnyRep, error) {
return s.impl.Discharge(ctx, 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/core/veyron/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.\n//\n// TODO(ataly,ashankar): Figure out a VDL representation for Discharge.\n// TODO(ataly,ashankar): Type of Caveat should become security.Caveat once\n// security.Caveat.ValidatorVOM goes away.",
InArgs: []ipc.ArgDesc{
{"Caveat", ``}, // vdl.AnyRep
{"Impetus", ``}, // security.DischargeImpetus
},
OutArgs: []ipc.ArgDesc{
{"Discharge", ``}, // vdl.AnyRep
{"err", ``}, // error
},
},
},
}