README
¶
Static selector
The Static selector returns the named service as a node for every request. This is useful where you want to offload discovery and balancing to DNS (particularly useful with KubeDNS).
This DOES however require a static port assignment (because we no longer have the ability to look up metadata). This defaults to port 8080, but can be overriddden at runtime using env-vars.
An optional domain-name can be appended too.
Environment variables
- "STATIC_SELECTOR_DOMAIN_NAME": An optional domain-name to append to the speicified service name.
- "STATIC_SELECTOR_PORT_NUMBER": Override the default port (8080) for "discovered" services.
Usage
selector := static.NewSelector()
service := micro.NewService(
client.NewClient(client.Selector(selector))
)
Documentation
¶
Overview ¶
Package static is a selector which always returns the name specified with a port-number appended. AN optional domain-name will also be added.
Index ¶
Constants ¶
View Source
const ( ENV_STATIC_SELECTOR_DOMAIN_NAME = "STATIC_SELECTOR_DOMAIN_NAME" ENV_STATIC_SELECTOR_PORT_NUMBER = "STATIC_SELECTOR_PORT_NUMBER" DEFAULT_PORT_NUMBER = "8080" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.