v.io: v.io/x/ref/lib/discovery/plugins/vine Index | Files

package vine

import "v.io/x/ref/lib/discovery/plugins/vine"

Package vine contains a discovery plugin that is using Vine protocol.

This plugin is for testing Vanadium applications under unpredictable and unfriendly network conditions.

Usage:

import (
	"v.io/x/ref/lib/discovery"
	"v.io/x/ref/lib/discovery/factory"
	"v.io/x/ref/lib/discovery/plugins/vine"
)

p, err := vine.New(...)
...
df, err := discovery.NewFactory(ctx, p)
...
// The factory should be injected before v23.NewDiscovery() is called.
factory.InjectFactory(df)

d, err := v23.NewDiscovery(ctx)
...

nolint:golint

Index

Package Files

store.go vine.go vine.vdl.go

Variables

var StoreDesc rpc.InterfaceDesc = descStore

StoreDesc describes the Store interface.

func New Uses

func New(ctx *context.T, name string, peers func(*context.T) []string) (idiscovery.Plugin, error)

New returns a new vine plugin instance with default ttl (90s).

func NewWithTTL Uses

func NewWithTTL(ctx *context.T, name string, peers func(*context.T) []string, ttl time.Duration) (idiscovery.Plugin, error)

New returns a new vine plugin instance. If ttl is zero, the default values will be used.

type StoreClientMethods Uses

type StoreClientMethods interface {
    // Add adds an advertisement with a given ttl.
    Add(_ *context.T, adinfo discovery_2.AdInfo, ttl time.Duration, _ ...rpc.CallOpt) error
    // Delete deletes the advertisement from the store.
    Delete(_ *context.T, id discovery.AdId, _ ...rpc.CallOpt) error
}

StoreClientMethods is the client interface containing Store methods.

Store is the interface for sharing advertisements between vine plugins.

type StoreClientStub Uses

type StoreClientStub interface {
    StoreClientMethods
}

StoreClientStub embeds StoreClientMethods and is a placeholder for additional management operations.

func StoreClient Uses

func StoreClient(name string) StoreClientStub

StoreClient returns a client stub for Store.

type StoreServerMethods Uses

type StoreServerMethods interface {
    // Add adds an advertisement with a given ttl.
    Add(_ *context.T, _ rpc.ServerCall, adinfo discovery_2.AdInfo, ttl time.Duration) error
    // Delete deletes the advertisement from the store.
    Delete(_ *context.T, _ rpc.ServerCall, id discovery.AdId) error
}

StoreServerMethods is the interface a server writer implements for Store.

Store is the interface for sharing advertisements between vine plugins.

type StoreServerStub Uses

type StoreServerStub interface {
    StoreServerStubMethods
    // DescribeInterfaces the Store interfaces.
    Describe__() []rpc.InterfaceDesc
}

StoreServerStub adds universal methods to StoreServerStubMethods.

func StoreServer Uses

func StoreServer(impl StoreServerMethods) StoreServerStub

StoreServer returns a server stub for Store. It converts an implementation of StoreServerMethods into an object that may be used by rpc.Server.

type StoreServerStubMethods Uses

type StoreServerStubMethods StoreServerMethods

StoreServerStubMethods is the server interface containing Store methods, as expected by rpc.Server. There is no difference between this interface and StoreServerMethods since there are no streaming methods.

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