discoverychain

package
v1.8.10 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

Compile assembles a discovery chain in the form of a graph of nodes using raw config entries and local context.

"Node" referenced in this file refers to a node in a graph and not to the Consul construct called a "Node".

Omitting router and splitter entries for services not using an L7 protocol (like HTTP) happens during initial fetching, but for sanity purposes a quick reinforcement of that happens here, too.

May return a *structs.ConfigEntryGraphError, but that is only expected when being used to validate modifications to the config entry graph. It should not be expected when compiling existing entries at runtime that are already valid.

func TestCompileConfigEntries

func TestCompileConfigEntries(
	t testing.T,
	serviceName string,
	evaluateInNamespace string,
	evaluateInDatacenter string,
	evaluateInTrustDomain string,
	useInDatacenter string,
	setup func(req *CompileRequest),
	entries ...structs.ConfigEntry,
) *structs.CompiledDiscoveryChain

Types

type CompileRequest

type CompileRequest struct {
	ServiceName           string
	EvaluateInNamespace   string
	EvaluateInDatacenter  string
	EvaluateInTrustDomain string
	UseInDatacenter       string // where the results will be used from

	// OverrideMeshGateway allows for the setting to be overridden for any
	// resolver in the compiled chain.
	OverrideMeshGateway structs.MeshGatewayConfig

	// OverrideProtocol allows for the final protocol for the chain to be
	// altered.
	//
	// - If the chain ordinarily would be TCP and an L7 protocol is passed here
	// the chain will not include Routers or Splitters.
	//
	// - If the chain ordinarily would be L7 and TCP is passed here the chain
	// will not include Routers or Splitters.
	OverrideProtocol string

	// OverrideConnectTimeout allows for the ConnectTimeout setting to be
	// overridden for any resolver in the compiled chain.
	OverrideConnectTimeout time.Duration

	Entries *structs.DiscoveryChainConfigEntries
}

Jump to

Keyboard shortcuts

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