blob: 6384510c22dc7c4f8a8f9da1fe2168f9494e686c [file] [log] [blame]
package server
import (
"veyron2/ipc"
"veyron2/security"
)
// signatureInvoker acts as the signature() method and is used to handle calls
// to signature() on behalf of the service
type signatureInvoker struct {
// signature of the service
sig ipc.ServiceSignature
}
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) ([]interface{}, security.Label, error) {
return []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
}