Documentation

Overview

    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)
    ...
    

    Index

    Constants

    This section is empty.

    Variables

    View Source
    var StoreDesc rpc.InterfaceDesc = descStore

      StoreDesc describes the Store interface.

      Functions

      func New

      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

        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.

          Types

          type StoreClientMethods

          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

            type StoreClientStub interface {
            	StoreClientMethods
            }

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

              func StoreClient

              func StoreClient(name string) StoreClientStub

                StoreClient returns a client stub for Store.

                type StoreServerMethods

                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

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

                    StoreServerStub adds universal methods to StoreServerStubMethods.

                    func StoreServer

                    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

                      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.