named

package
v0.4.0 Latest Latest
Warning

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

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

README

Named selector

The named selector returns the named service as a node for every request. This is useful where you want to offload discovery and balancing too a message bus.

When a service uses a message bus such as NATS for transport it will call transport.Listen with it's service name. This will force any instance of the service to subscribe to a topic with its service name. In combination with the named selector, we'll offload loadbalancing to the message bus itself.

Usage

selector := named.NewSelector()

service := micro.NewService(
	client.NewClient(client.Selector(selector))
)

Documentation

Overview

Package named is a selector which always returns the name selected.

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.