named

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

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