named

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Named selector

The named selector returns service name as the node address.

Why? This is useful where you want to offload discovery and load balancing to the transport itself e.g message bus.

Example

When a service uses a message bus such as NATS for transport it will use its service name as the address. This will force any instance of the service to subscribe to a topic with its own service name.

When a request is made to this service NATS will handle discovery and load balancing, essentially offloading this concern from micro to the message bus itself.

Usage

selector := named.NewSelector()

service := micro.NewService(
	micro.Selector(selector),
)

Documentation

Overview

Package named provides a selector which returns the service name as the address

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSelector

func NewSelector(opts ...selector.Option) selector.Selector

Types

This section is empty.

Jump to

Keyboard shortcuts

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