v.io: v.io/v23/vdlroot/signature Index | Files

package signature

import "v.io/v23/vdlroot/signature"

Package signature defines types representing interface and method signatures. nolint:golint

Index

Package Files

signature.vdl.go util.go

func MethodNames Uses

func MethodNames(sig []Interface) []string

MethodNames returns a sorted list of all method names from x.

type Arg Uses

type Arg struct {
    Name string
    Doc  string
    Type *vdl.Type // Type of the argument.
}

Arg describes the signature of a single argument.

func CopyArgs Uses

func CopyArgs(x []Arg) []Arg

CopyArgs returns a deep copy of x.

func (Arg) VDLIsZero Uses

func (x Arg) VDLIsZero() bool

func (*Arg) VDLRead Uses

func (x *Arg) VDLRead(dec vdl.Decoder) error

func (Arg) VDLReflect Uses

func (Arg) VDLReflect(struct {
    Name string `vdl:"signature.Arg"`
})

func (Arg) VDLWrite Uses

func (x Arg) VDLWrite(enc vdl.Encoder) error

type Embed Uses

type Embed struct {
    Name    string
    PkgPath string
    Doc     string
}

Embed describes the signature of an embedded interface.

func CopyEmbeds Uses

func CopyEmbeds(x []Embed) []Embed

CopyEmbeds returns a deep copy of x.

func (Embed) VDLIsZero Uses

func (x Embed) VDLIsZero() bool

func (*Embed) VDLRead Uses

func (x *Embed) VDLRead(dec vdl.Decoder) error

func (Embed) VDLReflect Uses

func (Embed) VDLReflect(struct {
    Name string `vdl:"signature.Embed"`
})

func (Embed) VDLWrite Uses

func (x Embed) VDLWrite(enc vdl.Encoder) error

type Interface Uses

type Interface struct {
    Name    string
    PkgPath string
    Doc     string
    Embeds  []Embed  // No special ordering.
    Methods []Method // Ordered by method name.
}

Interface describes the signature of an interface.

func CleanInterfaces Uses

func CleanInterfaces(sig []Interface) []Interface

CleanInterfaces returns a cleaned version of sig. Duplicate interfaces are merged, duplicate embeds and methods are dropped, and all methods are sorted by name.

func CopyInterface Uses

func CopyInterface(x Interface) Interface

CopyInterface returns a deep copy of x.

func CopyInterfaces Uses

func CopyInterfaces(x []Interface) []Interface

CopyInterfaces returns a deep copy of x.

func (*Interface) FindMethod Uses

func (s *Interface) FindMethod(name string) (Method, bool)

FindMethod returns the signature of the method with the given name and true iff the method exists, otherwise returns an empty signature and false.

func (Interface) VDLIsZero Uses

func (x Interface) VDLIsZero() bool

func (*Interface) VDLRead Uses

func (x *Interface) VDLRead(dec vdl.Decoder) error

func (Interface) VDLReflect Uses

func (Interface) VDLReflect(struct {
    Name string `vdl:"signature.Interface"`
})

func (Interface) VDLWrite Uses

func (x Interface) VDLWrite(enc vdl.Encoder) error

type Method Uses

type Method struct {
    Name      string
    Doc       string
    InArgs    []Arg        // Input arguments
    OutArgs   []Arg        // Output arguments
    InStream  *Arg         // Input stream (optional)
    OutStream *Arg         // Output stream (optional)
    Tags      []*vdl.Value // Method tags
}

Method describes the signature of an interface method.

func CopyMethod Uses

func CopyMethod(x Method) Method

CopyMethod returns a deep copy of x.

func CopyMethods Uses

func CopyMethods(x []Method) []Method

CopyMethods returns a deep copy of x.

func FirstMethod Uses

func FirstMethod(sig []Interface, name string) (Method, bool)

FirstMethod returns the signature of the method with the given name and true iff the method exists, otherwise returns an empty signature and false. If the method exists in more than one interface, we return the method from the the first interface with the given method name.

func (Method) VDLIsZero Uses

func (x Method) VDLIsZero() bool

func (*Method) VDLRead Uses

func (x *Method) VDLRead(dec vdl.Decoder) error

func (Method) VDLReflect Uses

func (Method) VDLReflect(struct {
    Name string `vdl:"signature.Method"`
})

func (Method) VDLWrite Uses

func (x Method) VDLWrite(enc vdl.Encoder) error

type SortableMethods Uses

type SortableMethods []Method

SortableMethods implements sort.Interface, ordering by method name.

func (SortableMethods) Len Uses

func (s SortableMethods) Len() int

func (SortableMethods) Less Uses

func (s SortableMethods) Less(i, j int) bool

func (SortableMethods) Swap Uses

func (s SortableMethods) Swap(i, j int)

Package signature imports 2 packages (graph) and is imported by 29 packages. Updated 2020-10-10. Refresh now. Tools for package owners.