router

package
v0.8.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertInboundAuthorizedToResourcers

func ConvertInboundAuthorizedToResourcers(suffix, namespace string, labels map[string]string, cs map[string]*Bound, getAuthorized func(name string) string) (map[string][]resource.Resourcer, error)

func ConvertInboundToResourcers

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

func ConvertOutboundToResourcers

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

Types

type AllowList

type AllowList struct {
	DirectStreamlocal  permissions.Permission `json:"direct-streamlocal"`
	DirectTcpip        permissions.Permission `json:"direct-tcpip"`
	StreamlocalForward permissions.Permission `json:"streamlocal-forward"`
	TcpipForward       permissions.Permission `json:"tcpip-forward"`
}

func (*AllowList) Merge

func (a *AllowList) Merge(a2 *AllowList) *AllowList

type Bound

type Bound struct {
	Outbound []*Chain
	Inbound  map[string]*AllowList
}

type Chain

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

type ClusterCache

type ClusterCache interface {
	ListServices(name string) []*corev1.Service
	GetHubGateway(hubName string, forHub string) v1alpha2.HubSpecGateway
	GetAuthorized(name string) string
	GetPortPeer(importHubName string, cluster, namespace, name string, port int32) int32
}

type HubsChain

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

func NewHubsChain

func NewHubsChain(conf HubsChainConfig) *HubsChain

func (*HubsChain) Build

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

type HubsChainConfig

type HubsChainConfig struct {
	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 {
	Labels        map[string]string
	ExportHubName string
	ImportHubName string
	ClusterCache  ClusterCache
}

type Solution

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

func NewSolution

func NewSolution(conf SolutionConfig) *Solution

func (*Solution) CalculateWays

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

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

type SolutionConfig

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

Jump to

Keyboard shortcuts

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