naming

package
v0.0.0-...-a9fda57 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2015 License: BSD-3-Clause, Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package naming defines the naming API and related data structures for gRPC. The interface is EXPERIMENTAL and may be suject to change.

Index

Constants

View Source
const (
	// Add indicates a new address is added.
	Add = iota
	// Delete indicates an exisiting address is deleted.
	Delete
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OP

type OP uint8

OP defines the corresponding operations for a name resolution change.

type Resolver

type Resolver interface {
	// Resolve returns the name resolution results.
	Resolve(target string) ([]*Update, error)
	// NewWatcher creates a Watcher to watch the changes on target.
	NewWatcher(target string) Watcher
}

Resolver does one-shot name resolution and creates a Watcher to watch the future updates.

type ServiceConfig

type ServiceConfig interface{}

type Update

type Update struct {
	// Op indicates the operation of the update.
	Op     OP
	Addr   string
	Config ServiceConfig
}

Update defines a name resolution change.

type Watcher

type Watcher interface {
	// Next blocks until an update or error happens. It may return one or more
	// updates.
	Next() ([]*Update, error)
	// Stop stops the Watcher.
	Stop()
}

Watcher watches the updates for a particular target.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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