router

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildServiceDiscovery added in v0.3.1

func BuildServiceDiscovery(name, namespace string, labels map[string]string, peerPortMapping map[int32]int32, spec *corev1.ServiceSpec) ([]resource.Resourcer, error)

BuildServiceDiscovery the Egress Discovery resource, perhaps Service or DNS

func ConvertChainsToResourcers added in v0.3.1

func ConvertChainsToResourcers(name, namespace string, labels map[string]string, cs map[string][]*Chain) (map[string][]resource.Resourcer, error)

Types

type Chain added in v0.3.1

type Chain struct {
	Bind  []string `json:"bind"`
	Proxy []string `json:"proxy"`
}

type HubsChain added in v0.3.1

type HubsChain struct {
	// contains filtered or unexported fields
}

func NewHubsChain added in v0.3.1

func NewHubsChain(conf HubsChainConfig) *HubsChain

func (*HubsChain) Build added in v0.3.1

func (h *HubsChain) Build(name string, origin, destination objref.ObjectRef, originPort, peerPort int32, ways []string) (hubsChains map[string][]*Chain, err error)

type HubsChainConfig added in v0.3.1

type HubsChainConfig struct {
	GetIdentity func(hubName string) string

	GetHubGateway func(hubName string, forHub string) v1alpha2.HubSpecGateway
}

type Router

type Router struct {
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(conf RouterConfig) *Router

func (*Router) BuildResource

func (d *Router) BuildResource(ways []string) (out map[string][]resource.Resourcer, err error)

func (*Router) SetRoutes

func (d *Router) SetRoutes(rules []*v1alpha2.Route)

type RouterConfig

type RouterConfig struct {
	Namespace     string
	Labels        map[string]string
	ExportHubName string
	ImportHubName string
	GetIdentity   func(hubName string) string
	GetHubGateway func(hubName string, forHub string) v1alpha2.HubSpecGateway
	ListServices  func(name string) []*corev1.Service
	GetPortPeer   func(importHubName string, cluster, namespace, name string, port int32) int32
}

type Solution added in v0.3.1

type Solution struct {
	// contains filtered or unexported fields
}

func NewSolution added in v0.3.1

func NewSolution(conf SolutionConfig) *Solution

func (*Solution) CalculateWays added in v0.3.1

func (s *Solution) CalculateWays(exportHub, importHub string) ([]string, error)

CalculateWays is calculated the ways based on the export hub and import hub

type SolutionConfig added in v0.3.1

type SolutionConfig struct {
	GetHubGateway func(hubName string, forHub string) v1alpha2.HubSpecGateway
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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