discovery

package
v0.0.0-...-ba1c585 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2017 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvertiseApp

func AdvertiseApp(ctx *context.T, visibility []security.BlessingPattern) (done <-chan struct{}, err error)

AdvertiseApp advertises that this peer is running their app with syncbase.

func ListenForAppPeers

func ListenForAppPeers(ctx *context.T, ch chan<- AppPeer) error

ListenForAppPeers listens via Discovery for peers that are running the same application as their context's blessing. Updates are sent through the provided channel. We stop listening and close the channel when the context is canceled.

func ListenForInvites

func ListenForInvites(ctx *context.T, db wire.Id, ch chan<- Invite) error

ListenForInvites listens via Discovery for syncgroup invitations for the given database and sends the invites to the provided channel. We stop listening when the given context is canceled. When that happens we close the given channel.

func ListenForPeers

func ListenForPeers(ctx *context.T, ch chan<- Peer) error

ListenForPeers listens via Discovery for syncgroup peers and sends them to the provided channel. We stop listening when the context is canceled. When that happens we close the given channel.

func NewDiscovery

func NewDiscovery(ctx *context.T, globalDiscoveryPath string, globalScanInterval time.Duration) (discovery.T, error)

NewDiscovery creates a new syncbase discovery object. globalDiscoveryPath is the path in the namespace where global disovery advertisements will be mounted. If globalDiscoveryPath is empty, no global discovery service will be created. globalScanInterval is the interval at which global discovery will be refreshed. If globalScanInterval is 0, the defaultScanInterval of global discovery will be used.

Types

type AppPeer

type AppPeer struct {
	AppName   string // The name of the app.
	Blessings string // The blessings pattern for this app peer.
	Lost      bool   // If this peer is a lost peer or not.
	// contains filtered or unexported fields
}

App Peer represents a Syncbase app peer found via Discovery. TODO(alexfandrianto): Can we include more than this? Peer Name? Addresses?

type Discovery

type Discovery struct {
	// contains filtered or unexported fields
}

Discovery implements v.io/v23/discovery.T for syncbase based applications. TODO(mattr): Actually this is not syncbase specific. At some point we should just replace the result of v23.NewDiscovery with this.

func (*Discovery) Advertise

func (d *Discovery) Advertise(ctx *context.T, ad *discovery.Advertisement, visibility []security.BlessingPattern) (<-chan struct{}, error)

Advertise implements v.io/v23/discovery/T.Advertise.

func (*Discovery) Scan

func (d *Discovery) Scan(ctx *context.T, query string) (<-chan discovery.Update, error)

Scan implements v.io/v23/discovery/T.Scan.

type Invite

type Invite struct {
	Syncgroup     wire.Id  // Syncgroup is the Id of the syncgroup you've been invited to.
	Addresses     []string // Addresses are the list of addresses of the inviting server.
	BlessingNames []string // BlessingNames are the list of blessings of the inviting server.
	Lost          bool     // If this invite is a lost invite or not.
	// contains filtered or unexported fields
}

Invite represents an invitation to join a syncgroup as found via Discovery.

type Peer

type Peer struct {
	Name      string   // Name is the name of the Syncbase peer's sync service.
	Addresses []string // Addresses are the list of addresses of the peer's server.
	Lost      bool     // If this peer is a lost peer or not.
	// contains filtered or unexported fields
}

Peer represents a Syncbase peer found via Discovery.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL