processor

package
v1.20.9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusCodeSuccess code for success status
	StatusCodeSuccess = 0
	// StatusCodeError code for error status
	StatusCodeError = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppServiceHandler

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

AppServiceHandler handler for AppService

func NewAppServiceHandler

func NewAppServiceHandler() *AppServiceHandler

NewAppServiceHandler create AppService handler

func (*AppServiceHandler) OnAdd

func (handler *AppServiceHandler) OnAdd(obj interface{})

OnAdd AppService add event

func (*AppServiceHandler) OnDelete

func (handler *AppServiceHandler) OnDelete(obj interface{})

OnDelete AppService delete event

func (*AppServiceHandler) OnUpdate

func (handler *AppServiceHandler) OnUpdate(objOld, objNew interface{})

OnUpdate AppService update event

func (*AppServiceHandler) RegisterProcessor

func (handler *AppServiceHandler) RegisterProcessor(p HandlerProcessor)

RegisterProcessor register processor to handler

type ClbIngressStatus

type ClbIngressStatus struct {
	Name      string
	Namespace string
	clbingressType.ClbIngressSpec
	clbingressType.ClbIngressStatus
	AppSvcs map[string]*serviceclient.AppService
}

ClbIngressStatus clb ingress status

type CloudListenerStatus

type CloudListenerStatus struct {
	Name      string
	Namespace string
	cloudListenerType.CloudListenerSpec
}

CloudListenerStatus cloud listener status

type HandlerProcessor

type HandlerProcessor interface {
	SetUpdated()
}

HandlerProcessor processor interface

type IngressHandler

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

IngressHandler ingress handler

func NewIngressHandler

func NewIngressHandler() *IngressHandler

NewIngressHandler create ingress handler

func (*IngressHandler) OnAdd

func (handler *IngressHandler) OnAdd(obj interface{})

OnAdd ingress add event

func (*IngressHandler) OnDelete

func (handler *IngressHandler) OnDelete(obj interface{})

OnDelete ingress delete event

func (*IngressHandler) OnUpdate

func (handler *IngressHandler) OnUpdate(objOld, objNew interface{})

OnUpdate ingress update event

func (*IngressHandler) RegisterProcessor

func (handler *IngressHandler) RegisterProcessor(p HandlerProcessor)

RegisterProcessor register processor to ingress handler

type ListenerHandler

type ListenerHandler struct{}

ListenerHandler listener handler

func NewListenerHandler

func NewListenerHandler() *ListenerHandler

NewListenerHandler create listener handler

func (*ListenerHandler) OnAdd

func (handler *ListenerHandler) OnAdd(obj interface{})

OnAdd listener add event

func (*ListenerHandler) OnDelete

func (handler *ListenerHandler) OnDelete(obj interface{})

OnDelete listener delete event

func (*ListenerHandler) OnUpdate

func (handler *ListenerHandler) OnUpdate(objOld, objNew interface{})

OnUpdate listener update event

type NodeHandler

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

NodeHandler node handler

func NewNodeHandler

func NewNodeHandler() *NodeHandler

NewNodeHandler create node handler

func (*NodeHandler) OnAdd

func (handler *NodeHandler) OnAdd(obj interface{})

OnAdd node add event

func (*NodeHandler) OnDelete

func (handler *NodeHandler) OnDelete(obj interface{})

OnDelete node delete event

func (*NodeHandler) OnUpdate

func (handler *NodeHandler) OnUpdate(objOld, objNew interface{})

OnUpdate node update event

func (*NodeHandler) RegisterProcessor

func (handler *NodeHandler) RegisterProcessor(p HandlerProcessor)

RegisterProcessor register processor to node handler

type Option

type Option struct {
	Port            int
	ServiceRegistry string
	ClbName         string
	NetType         string
	BackendIPType   string
	Namespace       string
	Cluster         string
	Kubeconfig      string
	UpdatePeriod    int
	NodeSyncPeriod  int
	SyncPeriod      int
}

Option processor options

type Processor

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

Processor processor for ingresses and services

func NewProcessor

func NewProcessor(opt *Option) (*Processor, error)

NewProcessor create processor for clb controller

func (*Processor) Collect

func (p *Processor) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus exporter Collect interface

func (*Processor) Describe

func (p *Processor) Describe(ch chan<- *prometheus.Desc)

Describe implements promethues exporter Describe interface

func (*Processor) GetStatusFunction

func (p *Processor) GetStatusFunction() restful.RouteFunction

GetStatusFunction get status function

func (*Processor) Handle

func (p *Processor) Handle()

Handle handle update event

func (*Processor) Init

func (p *Processor) Init() error

Init init processor

func (*Processor) Run

func (p *Processor) Run()

Run run processor

func (*Processor) SetUpdated

func (p *Processor) SetUpdated()

SetUpdated set processor updated

func (*Processor) Stop

func (p *Processor) Stop()

Stop stop processor

type RemoteListenerStatus

RemoteListenerStatus remote listener status

type Status

type Status struct {
	Ingresses       []*ClbIngressStatus     `json:"ingresses"`
	CloudListeners  []*CloudListenerStatus  `json:"cloudListeners"`
	RemoteListeners []*RemoteListenerStatus `json:"remoteListeners"`
}

Status status

type StatusResponse

type StatusResponse struct {
	Code    int     `json:"code"`
	Message string  `json:"message"`
	Data    *Status `json:"data,omitempty"`
}

StatusResponse status response

type Updater

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

Updater generate listeners from ingress and service discovery

func NewUpdater

func NewUpdater(opt *Option, svcClient svcclient.Client,
	ingressRegistry clbingress.Registry, listenerClient listenerclient.Interface) (*Updater, error)

NewUpdater create updater

func (*Updater) EnsureLoadBalancer

func (updater *Updater) EnsureLoadBalancer() error

EnsureLoadBalancer create new loadbalance cloud lb instance or take over existed cloud lb instance

func (*Updater) ListRemoteListener

func (updater *Updater) ListRemoteListener() ([]*cloudListenerType.CloudListener, error)

ListRemoteListener list remote listener currently it calls cloud api directly TODO: cloud lb interface should has events informer this function should get remote listeners from local cache

func (*Updater) Update

func (updater *Updater) Update() error

Update sync update to clb

Jump to

Keyboard shortcuts

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