api

package
v0.0.0-...-fe29b7c Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulConfiguration

type ConsulConfiguration struct {
	Host    string
	Service string
	Tag     string
}

func NewConsulConfiguration

func NewConsulConfiguration() *ConsulConfiguration

type ServerDefinition

type ServerDefinition struct {
	// Constructed scheme://Host:port URL for region redirection - note that this excludes both the path specification
	// and query parameters, as these will be lazily inserted by the middleware
	URL url.URL

	// ISO 3166-1 alpha-2 country code - e.g. de
	CountryCode string

	// Is the server designated as the default handler for unmatched country codes?
	DefaultServer bool
}

func ConsulRegionRoutes

func ConsulRegionRoutes(config *ConsulConfiguration) ([]*ServerDefinition, error)

ConsulRegionRoutes returns a list of servers and regions for a specific service and tag

func ServerDefinitionFromCatalogService

func ServerDefinitionFromCatalogService(entry *consul.CatalogService) *ServerDefinition

ServerDefinitionFromServiceEntry creates a routing definition for a region from a Consul Catalog Service

func ServerDefinitionFromServiceEntry

func ServerDefinitionFromServiceEntry(entry *consul.ServiceEntry) *ServerDefinition

ServerDefinitionFromServiceEntry creates a routing definition for a region from a Consul Service entry

func ServerDefinitionsFromServiceEntries

func ServerDefinitionsFromServiceEntries(entries []*consul.ServiceEntry) []*ServerDefinition

Jump to

Keyboard shortcuts

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