resolver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPlugin = "host"

DefaultPlugin is a constant 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 InstallDestinationResolverPlugin

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

InstallDestinationResolverPlugin function installs new plugin

func SetDefaultDestinationResolver

func SetDefaultDestinationResolver(name string, dr DestinationResolver)

SetDefaultDestinationResolver set the a default implementation for a protocol, so that you don't need to set config file

Types

type DefaultDestinationResolver

type DefaultDestinationResolver struct {
}

DefaultDestinationResolver is a struct mesher as sidecar must use DefaultDestinationResolver

func (*DefaultDestinationResolver) Resolve

func (dr *DefaultDestinationResolver) Resolve(remoteIP, host, rawURI string, header map[string]string) (string, string, error)

Resolve resolves service's endpoint service may have multiple port for same protocol

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(remoteIP, host, rawURI string, header map[string]string) (string, string, error)
}

DestinationResolver is a interface with Resolve method

func GetDestinationResolver

func GetDestinationResolver(name string) DestinationResolver

GetDestinationResolver returns destinationResolver pointer

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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