informer

package
v0.0.0-...-1ae172a Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	ClusterAgentInformer(token string) Informer

	PipelineRunInformer(cond *pipeline.PipelineRunWatchCondition) Informer
	PipelineRunJobInformer(cond *pipeline.PipelineRunJobWatchCondition) Informer
	PipelineTriggerInformer(cond *pipeline.PipelineTriggerWatchCondition) Informer
	PipelineTriggerEventInformer(cond *pipeline.PipelineTriggerEventWatchCondition) Informer
	PipelineCodeCacheInformer(cond *pipeline.PipelineCodeCacheWatchCondition) Informer

	SpaceletInformer(cond *spacelet.SpaceletWatchCondition) Informer
}

func NewInformerFactory

func NewInformerFactory(config *config.ListWatcherConfig) Factory

type Handler

type Handler interface {
	Check(interface{}) bool
	Handle(interface{}) error
}

Handler informer监听到资源后,首先调用该处理器中的Check,判断是否需要处理 之后调用Handle进行处理

type Informer

type Informer interface {
	Run(stopCh <-chan struct{})
	AddHandler(Handler)
}

func NewInformer

func NewInformer(listWatcher listwatcher.Interface) Informer

type ResourceHandler

type ResourceHandler struct {
	CheckFunc  func(interface{}) bool
	HandleFunc func(interface{}) error
}

ResourceHandler 通用资源处理对象,也可以自定义对象,实现Handler接口

func (*ResourceHandler) Check

func (h *ResourceHandler) Check(obj interface{}) bool

func (*ResourceHandler) Handle

func (h *ResourceHandler) Handle(obj interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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