Documentation ¶
Overview ¶
Package internal provides a VDL specification for a service used in the unittest of the access package.
Index ¶
Constants ¶
const Execute = MyTag("X")
const Read = MyTag("R")
For this example/unittest, there are three possible values of MyTag, each represented by a single-character string.
const Write = MyTag("W")
Variables ¶
var MyObjectDesc rpc.InterfaceDesc = descMyObject
MyObjectDesc describes the MyObject interface.
Functions ¶
This section is empty.
Types ¶
type MyObjectClientMethods ¶
type MyObjectClientMethods interface { Get(*context.T, ...rpc.CallOpt) error Put(*context.T, ...rpc.CallOpt) error Resolve(*context.T, ...rpc.CallOpt) error NoTags(*context.T, ...rpc.CallOpt) error // No tags attached to this. }
MyObjectClientMethods is the client interface containing MyObject methods.
MyObject demonstrates how tags are attached to methods.
type MyObjectClientStub ¶
type MyObjectClientStub interface { MyObjectClientMethods rpc.UniversalServiceMethods }
MyObjectClientStub adds universal methods to MyObjectClientMethods.
func MyObjectClient ¶
func MyObjectClient(name string) MyObjectClientStub
MyObjectClient returns a client stub for MyObject.
type MyObjectServerMethods ¶
type MyObjectServerMethods interface { Get(*context.T, rpc.ServerCall) error Put(*context.T, rpc.ServerCall) error Resolve(*context.T, rpc.ServerCall) error NoTags(*context.T, rpc.ServerCall) error // No tags attached to this. }
MyObjectServerMethods is the interface a server writer implements for MyObject.
MyObject demonstrates how tags are attached to methods.
type MyObjectServerStub ¶
type MyObjectServerStub interface { MyObjectServerStubMethods // Describe the MyObject interfaces. Describe__() []rpc.InterfaceDesc }
MyObjectServerStub adds universal methods to MyObjectServerStubMethods.
func MyObjectServer ¶
func MyObjectServer(impl MyObjectServerMethods) MyObjectServerStub
MyObjectServer returns a server stub for MyObject. It converts an implementation of MyObjectServerMethods into an object that may be used by rpc.Server.
type MyObjectServerStubMethods ¶
type MyObjectServerStubMethods MyObjectServerMethods
MyObjectServerStubMethods is the server interface containing MyObject methods, as expected by rpc.Server. There is no difference between this interface and MyObjectServerMethods since there are no streaming methods.
type MyTag ¶
type MyTag string
Any package can define tags (of arbitrary types) to be attached to methods. This type can be used to index into a Permissions.
func (*MyTag) MakeVDLTarget ¶
type MyTagTarget ¶
type MyTagTarget struct { Value *MyTag vdl.TargetBase }
func (*MyTagTarget) FromString ¶
func (t *MyTagTarget) FromString(src string, tt *vdl.Type) error