blob: f3eaa39319c0868dbf83dd85dc5bab6620cf9f61 [file] [log] [blame]
package server
import (
"veyron.io/veyron/veyron2/ipc"
"veyron.io/veyron/veyron2/security"
vdlsig "veyron.io/veyron/veyron2/vdl/vdlroot/src/signature"
)
// signatureInvoker acts as the signature() method and is used to handle calls
// to signature() on behalf of the service
//
// TODO(toddw): Replace this with the new Signature call.
type signatureInvoker struct {
// signature of the service
sig ipc.ServiceSignature
}
var _ ipc.Invoker = (*signatureInvoker)(nil)
func (i *signatureInvoker) signature() ipc.ServiceSignature {
return i.sig
}
// newSignatureInvoker is an invoker factory
func newSignatureInvoker(sig ipc.ServiceSignature) ipc.Invoker {
return &signatureInvoker{sig}
}
// Prepare implements the Invoker interface.
func (i *signatureInvoker) Prepare(methodName string, _ int) (argptrs, tags []interface{}, err error) {
return []interface{}{}, []interface{}{security.ReadLabel}, nil
}
// Invoke implements the Invoker interface.
func (i *signatureInvoker) Invoke(methodName string, call ipc.ServerCall, argptrs []interface{}) ([]interface{}, error) {
return []interface{}{i.signature(), nil}, nil
}
func (i *signatureInvoker) Globber() *ipc.GlobState {
return nil
}
func (i *signatureInvoker) Signature(ctx ipc.ServerContext) ([]vdlsig.Interface, error) {
return nil, nil
}
func (i *signatureInvoker) MethodSignature(ctx ipc.ServerContext, method string) (vdlsig.Method, error) {
return vdlsig.Method{}, nil
}