v.io: v.io/x/ref/runtime/protocols/vine Index | Files

package vine

import "v.io/x/ref/runtime/protocols/vine"

Package vine contains Vanadium's Implementation of Network Emulation (VINE). VINE provides the ability to dynamically specific a network topology (e.g. A can reach B, but A cannot reach C) with various network charcteristics (e.g. A can reach B with latency of 500ms). This can be useful for testing Vanadium applications under unpredictable and unfriendly network conditions.

nolint:golint

Index

Package Files

vine.go vine.vdl.go

Variables

var (
    ErrInvalidAddress       = verror.NewIDAction("v.io/x/ref/runtime/protocols/vine.InvalidAddress", verror.NoRetry)
    ErrAddressNotReachable  = verror.NewIDAction("v.io/x/ref/runtime/protocols/vine.AddressNotReachable", verror.NoRetry)
    ErrNoRegisteredProtocol = verror.NewIDAction("v.io/x/ref/runtime/protocols/vine.NoRegisteredProtocol", verror.NoRetry)
    ErrCantAcceptFromTag    = verror.NewIDAction("v.io/x/ref/runtime/protocols/vine.CantAcceptFromTag", verror.NoRetry)
)
var VineDesc rpc.InterfaceDesc = descVine

VineDesc describes the Vine interface.

func ErrorfAddressNotReachable Uses

func ErrorfAddressNotReachable(ctx *context.T, format string, address string) error

ErrorfAddressNotReachable calls ErrAddressNotReachable.Errorf with the supplied arguments.

func ErrorfCantAcceptFromTag Uses

func ErrorfCantAcceptFromTag(ctx *context.T, format string, tag string) error

ErrorfCantAcceptFromTag calls ErrCantAcceptFromTag.Errorf with the supplied arguments.

func ErrorfInvalidAddress Uses

func ErrorfInvalidAddress(ctx *context.T, format string, address string) error

ErrorfInvalidAddress calls ErrInvalidAddress.Errorf with the supplied arguments.

func ErrorfNoRegisteredProtocol Uses

func ErrorfNoRegisteredProtocol(ctx *context.T, format string, protocol string) error

ErrorfNoRegisteredProtocol calls ErrNoRegisteredProtocol.Errorf with the supplied arguments.

func Init Uses

func Init(ctx *context.T, name string, auth security.Authorizer, localTag string, discoveryTTL time.Duration) (*context.T, func(), error)

Init initializes the vine server mounted under name using auth as its authorization policy and registers the vine protocol. discoveryTTL specifies the ttl of scanned advertisings for the vine discovery plugin. The ctx returned from Init: (1) has localTag as the default localTag for dialers and acceptors. (2) has all addresses in the listenspec altered to listen on the vine protocol.

func MessageAddressNotReachable Uses

func MessageAddressNotReachable(ctx *context.T, message string, address string) error

MessageAddressNotReachable calls ErrAddressNotReachable.Message with the supplied arguments.

func MessageCantAcceptFromTag Uses

func MessageCantAcceptFromTag(ctx *context.T, message string, tag string) error

MessageCantAcceptFromTag calls ErrCantAcceptFromTag.Message with the supplied arguments.

func MessageInvalidAddress Uses

func MessageInvalidAddress(ctx *context.T, message string, address string) error

MessageInvalidAddress calls ErrInvalidAddress.Message with the supplied arguments.

func MessageNoRegisteredProtocol Uses

func MessageNoRegisteredProtocol(ctx *context.T, message string, protocol string) error

MessageNoRegisteredProtocol calls ErrNoRegisteredProtocol.Message with the supplied arguments.

func NewErrAddressNotReachable Uses

func NewErrAddressNotReachable(ctx *context.T, address string) error

NewErrAddressNotReachable returns an error with the ErrAddressNotReachable ID. Deprecated: this function will be removed in the future, use ErrorfAddressNotReachable or MessageAddressNotReachable instead.

func NewErrCantAcceptFromTag Uses

func NewErrCantAcceptFromTag(ctx *context.T, tag string) error

NewErrCantAcceptFromTag returns an error with the ErrCantAcceptFromTag ID. Deprecated: this function will be removed in the future, use ErrorfCantAcceptFromTag or MessageCantAcceptFromTag instead.

func NewErrInvalidAddress Uses

func NewErrInvalidAddress(ctx *context.T, address string) error

NewErrInvalidAddress returns an error with the ErrInvalidAddress ID. Deprecated: this function will be removed in the future, use ErrorfInvalidAddress or MessageInvalidAddress instead.

func NewErrNoRegisteredProtocol Uses

func NewErrNoRegisteredProtocol(ctx *context.T, protocol string) error

NewErrNoRegisteredProtocol returns an error with the ErrNoRegisteredProtocol ID. Deprecated: this function will be removed in the future, use ErrorfNoRegisteredProtocol or MessageNoRegisteredProtocol instead.

func ParamsErrAddressNotReachable Uses

func ParamsErrAddressNotReachable(argumentError error) (verrorComponent string, verrorOperation string, address string, returnErr error)

ParamsErrAddressNotReachable extracts the expected parameters from the error's ParameterList.

func ParamsErrCantAcceptFromTag Uses

func ParamsErrCantAcceptFromTag(argumentError error) (verrorComponent string, verrorOperation string, tag string, returnErr error)

ParamsErrCantAcceptFromTag extracts the expected parameters from the error's ParameterList.

func ParamsErrInvalidAddress Uses

func ParamsErrInvalidAddress(argumentError error) (verrorComponent string, verrorOperation string, address string, returnErr error)

ParamsErrInvalidAddress extracts the expected parameters from the error's ParameterList.

func ParamsErrNoRegisteredProtocol Uses

func ParamsErrNoRegisteredProtocol(argumentError error) (verrorComponent string, verrorOperation string, protocol string, returnErr error)

ParamsErrNoRegisteredProtocol extracts the expected parameters from the error's ParameterList.

func WithLocalTag Uses

func WithLocalTag(ctx *context.T, tag string) *context.T

WithLocalTag returns a ctx that will have localTag as the default localTag for dialers and acceptors. This local tag will be inserted into any listening endpoints. i.e "net/address" -> "net/address/tag"

type PeerBehavior Uses

type PeerBehavior struct {
    // Reachable specifies whether the outgoing or incoming connection can be
    // dialed or accepted.
    // TODO(suharshs): Make this a user defined error which vine will return instead of a bool.
    Reachable bool
    // Discoverable specifies whether the Dialer can advertise a discovery packet
    // to the Acceptor. This is useful for emulating neighborhoods.
    // TODO(suharshs): Discoverable should always be bidirectional. It is unrealistic for
    // A to discover B, but not vice versa.
    Discoverable bool
}

PeerBehavior specifies characteristics of a connection.

func (PeerBehavior) VDLIsZero Uses

func (x PeerBehavior) VDLIsZero() bool

func (*PeerBehavior) VDLRead Uses

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

func (PeerBehavior) VDLReflect Uses

func (PeerBehavior) VDLReflect(struct {
    Name string `vdl:"v.io/x/ref/runtime/protocols/vine.PeerBehavior"`
})

func (PeerBehavior) VDLWrite Uses

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

type PeerKey Uses

type PeerKey struct {
    Dialer   string
    Acceptor string
}

PeerKey is a key that represents a connection from a Dialer tag to an Acceptor tag.

func (PeerKey) VDLIsZero Uses

func (x PeerKey) VDLIsZero() bool

func (*PeerKey) VDLRead Uses

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

func (PeerKey) VDLReflect Uses

func (PeerKey) VDLReflect(struct {
    Name string `vdl:"v.io/x/ref/runtime/protocols/vine.PeerKey"`
})

func (PeerKey) VDLWrite Uses

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

type VineClientMethods Uses

type VineClientMethods interface {
    // SetBehaviors sets the policy that the accepting vine service's process
    // will use on connections.
    // behaviors is a map from server tag to the desired connection behavior.
    // For example,
    //   client.SetBehaviors(map[PeerKey]PeerBehavior{PeerKey{"foo", "bar"}, PeerBehavior{Reachable: false}})
    // will cause all vine protocol dial calls from "foo" to "bar" to fail.
    SetBehaviors(_ *context.T, behaviors map[PeerKey]PeerBehavior, _ ...rpc.CallOpt) error
}

VineClientMethods is the client interface containing Vine methods.

Vine is the interface to a vine service that can dynamically change the network behavior of connection's on the vine service's process.

type VineClientStub Uses

type VineClientStub interface {
    VineClientMethods
}

VineClientStub embeds VineClientMethods and is a placeholder for additional management operations.

func VineClient Uses

func VineClient(name string) VineClientStub

VineClient returns a client stub for Vine.

type VineServerMethods Uses

type VineServerMethods interface {
    // SetBehaviors sets the policy that the accepting vine service's process
    // will use on connections.
    // behaviors is a map from server tag to the desired connection behavior.
    // For example,
    //   client.SetBehaviors(map[PeerKey]PeerBehavior{PeerKey{"foo", "bar"}, PeerBehavior{Reachable: false}})
    // will cause all vine protocol dial calls from "foo" to "bar" to fail.
    SetBehaviors(_ *context.T, _ rpc.ServerCall, behaviors map[PeerKey]PeerBehavior) error
}

VineServerMethods is the interface a server writer implements for Vine.

Vine is the interface to a vine service that can dynamically change the network behavior of connection's on the vine service's process.

type VineServerStub Uses

type VineServerStub interface {
    VineServerStubMethods
    // DescribeInterfaces the Vine interfaces.
    Describe__() []rpc.InterfaceDesc
}

VineServerStub adds universal methods to VineServerStubMethods.

func VineServer Uses

func VineServer(impl VineServerMethods) VineServerStub

VineServer returns a server stub for Vine. It converts an implementation of VineServerMethods into an object that may be used by rpc.Server.

type VineServerStubMethods Uses

type VineServerStubMethods VineServerMethods

VineServerStubMethods is the server interface containing Vine methods, as expected by rpc.Server. There is no difference between this interface and VineServerMethods since there are no streaming methods.

Package vine imports 16 packages (graph). Updated 2020-10-24. Refresh now. Tools for package owners.