srv

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Package srv provides server connectivity for loadbalanceroperator

Index

Constants

View Source
const (
	LBPrefix = "loadbal"
)

Variables

View Source
var (
	// ErrPortsRequired is returned when a healthcheck port has not been provided
	ErrPortsRequired = errors.New("no ports provided")
)

Functions

func NewRunner

func NewRunner(ctx context.Context, tr taskRunner) *runner

Types

type Message

type Message interface {
	events.EventMessage | events.ChangeMessage
	GetTraceContext(ctx context.Context) context.Context
	GetEventType() string
	GetSubject() gidx.PrefixedID
	GetAddSubjects() []gidx.PrefixedID
}

type Server

type Server struct {
	APIClient        *lbapi.Client
	BackoffConfig    backoff.Policy
	IPAMClient       *ipamclient.Client
	MetadataClient   *metadata.Client
	Echo             *echox.Server
	Context          context.Context
	EventsConnection events.Connection

	Logger           *zap.SugaredLogger
	KubeClient       *rest.Config
	Debug            bool
	EventTopics      []string
	ChangeTopics     []string
	Chart            *chart.Chart
	ChartPath        string
	ValuesPath       string
	Locations        []string
	ServicePortKey   string
	ContainerPortKey string
	MetricsPort      int
	LoadBalancers    map[string]*runner
	// contains filtered or unexported fields
}

Server holds options for server connectivity and settings

func (*Server) CreateNamespace

func (s *Server) CreateNamespace(ctx context.Context, hash string) (*v1.Namespace, error)

CreateNamespace creates namespaces for the specified group that is provided in the event received

func (Server) LoadBalancerStatusUpdate added in v0.2.0

func (s Server) LoadBalancerStatusUpdate(ctx context.Context, loadBalancerID gidx.PrefixedID, status *metastatus.LoadBalancerStatus) error

LoadBalancerStatusUpdate updates the state of a load balancer in the metadata service

func (*Server) Routes

func (s *Server) Routes(g *echo.Group)

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run will start the server queue connections and healthcheck endpoints

func (*Server) Shutdown

func (s *Server) Shutdown() error

Jump to

Keyboard shortcuts

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