router

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 15 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][]objref.KMetadata, error)

func ConvertInboundToResourcers

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

func ConvertOutboundToResourcers

func ConvertOutboundToResourcers(name, namespace string, labels map[string]string, cs map[string]*Bound) (map[string][]objref.KMetadata, 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 HubInterface

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

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) trafficv1alpha2.HubSpecGateway
}

type Manual

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

func NewManual

func NewManual(conf ManualConfig) *Manual

func (*Manual) BuildResource

func (f *Manual) BuildResource() (out map[string][]objref.KMetadata, err error)

type ManualConfig

type ManualConfig struct {
	Labels           map[string]string
	RouteName        string
	ExportHubName    string
	ExportName       string
	ExportNamespace  string
	ExportAuthorized string
	ExportGateway    trafficv1alpha2.HubSpecGateway
	ImportHubName    string
	ImportName       string
	ImportNamespace  string
	ImportAuthorized string
	ImportGateway    trafficv1alpha2.HubSpecGateway
	Port             int32
	BindPort         int32
}

type Router

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

func NewRouter

func NewRouter(conf RouterConfig) *Router

func (*Router) BuildResource

func (d *Router) BuildResource(rules []*trafficv1alpha2.Route, ways []string) (out map[string][]objref.KMetadata, err error)

type RouterConfig

type RouterConfig struct {
	Labels        map[string]string
	ExportHubName string
	ImportHubName string
	HubInterface  HubInterface
}

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) trafficv1alpha2.HubSpecGateway
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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