controlplane

package
v2.2.18 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRoute

func DefaultRoute() *route.Route

func Main

func Main(ctx context.Context, filename string, port uint, logger *log.Logger) error

func OriginCluster

func OriginCluster() *cluster.Cluster

func RunServer

func RunServer(ctx context.Context, server serverv3.Server, port uint) error

func ToCluster

func ToCluster(clusterName string) *cluster.Cluster

func ToEndPoint

func ToEndPoint(clusterName string, localTunIP string, port int32) *endpoint.ClusterLoadAssignment

func ToListener

func ToListener(listenerName string, routeName string, port int32, p corev1.Protocol) *listener.Listener

func ToRoute

func ToRoute(clusterName string, headers map[string]string) *route.Route

func Watch

func Watch(watcher *fsnotify.Watcher, filename string, notifyCh chan<- NotifyMessage) error

Types

type NotifyMessage

type NotifyMessage struct {
	Operation OperationType
	FilePath  string
}

type OperationType

type OperationType int
const (
	Create OperationType = iota
	Remove
	Modify
)

type Processor

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

func NewProcessor

func NewProcessor(cache cache.SnapshotCache, log *log.Logger) *Processor

func (*Processor) ProcessFile

func (p *Processor) ProcessFile(file NotifyMessage) error

type Rule

type Rule struct {
	Headers      map[string]string
	LocalTunIPv4 string
	LocalTunIPv6 string
	PortMap      map[int32]int32
}

type Virtual

type Virtual struct {
	Uid   string // group.resource.name
	Ports []corev1.ContainerPort
	Rules []*Rule
}

func ParseYaml

func ParseYaml(file string) ([]*Virtual, error)

func (*Virtual) To

func (a *Virtual) To() (
	listeners []types.Resource,
	clusters []types.Resource,
	routes []types.Resource,
	endpoints []types.Resource,
)

Jump to

Keyboard shortcuts

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