resolver

package
v0.0.0-...-4d3f714 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPlugin = "host"

DefaultPlugin is a contant which stores default plugin name

Variables

View Source
var DestinationResolverPlugins map[string]func() DestinationResolver

DestinationResolverPlugins is a map

View Source
var (
	//ErrFoo is of type error
	ErrFoo = errors.New("resolved as a nil service")
)
View Source
var ErrUnknownResolver = errors.New("unknown Destination Resolver")

ErrUnknownResolver is of type error

View Source
var SelfEndpoint = "#To be init#"

SelfEndpoint is a string

Functions

func Init

func Init() error

Init function reads config and initiates it

func InstallDestinationResolver

func InstallDestinationResolver(name string, newFunc func() DestinationResolver)

InstallDestinationResolver function installs new plugin

Types

type DefaultDestinationResolver

type DefaultDestinationResolver struct {
}

DefaultDestinationResolver is a struct

func (*DefaultDestinationResolver) Resolve

func (dr *DefaultDestinationResolver) Resolve(sourceAddr string, header map[string]string, rawURI string, destinationName *string) error

Resolve resolves service's endpoint

type DefaultSourceResolver

type DefaultSourceResolver struct {
}

DefaultSourceResolver is a struct

func (*DefaultSourceResolver) Resolve

func (sr *DefaultSourceResolver) Resolve(source string) *registry.SourceInfo

Resolve is a method which resolves service endpoint

type DestinationResolver

type DestinationResolver interface {
	Resolve(sourceAddr string, header map[string]string, rawURI string, destinationName *string) error
}

DestinationResolver is a interface with Resolve method

func GetDestinationResolver

func GetDestinationResolver() DestinationResolver

GetDestinationResolver returns destinationResolver object

func New

func New() DestinationResolver

New function returns new DefaultDestinationResolver struct object

type SourceResolver

type SourceResolver interface {
	Resolve(source string) *registry.SourceInfo
}

SourceResolver is a interface which has Resolve function

func GetSourceResolver

func GetSourceResolver() SourceResolver

GetSourceResolver returns interface object

Jump to

Keyboard shortcuts

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