service

package
v0.0.0-...-51da36d Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPFromRequest

func GetIPFromRequest(r *http.Request) (string, error)

func NewHandler

func NewHandler(typeName string, add api.AddObj, update api.UpdateObj, delete api.DeleteObj, boardcast boardcast) cache.ResourceEventHandlerFuncs

Types

type Config

type Config struct {
	KubeAuthType  kubernetes.AuthType
	KubeConfigDir string
	// EnableFetchReplicaSet controls whether to fetch ReplicaSet information.
	// The default value is false. It should be enabled if the ReplicaSet
	// is used to control pods in the third-party CRD except for Deployment.
	EnableFetchReplicaSet bool
	LogInterval           int
}

type EventCount

type EventCount struct {
	Add    atomic.Int64
	Delete atomic.Int64
	Update atomic.Int64
}

func (*EventCount) AddEvent

func (c *EventCount) AddEvent(operation string)

func (*EventCount) String

func (c *EventCount) String() string

type K8sResourceHandler

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

func (*K8sResourceHandler) AddObj

func (m *K8sResourceHandler) AddObj(obj interface{})

func (*K8sResourceHandler) DeleteObj

func (m *K8sResourceHandler) DeleteObj(obj interface{})

func (*K8sResourceHandler) UpdateObj

func (m *K8sResourceHandler) UpdateObj(objOld interface{}, objNew interface{})

type MetaDataWrapper

type MetaDataWrapper struct {
	ReceivedPodsEventCount    EventCount
	ReceivedRsEventCount      EventCount
	ReceivedServiceEventCount EventCount
	ReceivedNodesEventCount   EventCount
	// contains filtered or unexported fields
}

func NewMetaDataWrapper

func NewMetaDataWrapper(config *Config) (*MetaDataWrapper, error)

func (*MetaDataWrapper) AddFlusher

func (s *MetaDataWrapper) AddFlusher(w *Watcher)

func (*MetaDataWrapper) ListAndWatch

func (s *MetaDataWrapper) ListAndWatch(w http.ResponseWriter, r *http.Request)

func (*MetaDataWrapper) ListWithSemaphore

func (s *MetaDataWrapper) ListWithSemaphore(ctx context.Context, f *ioutil.WriteFlusher, ip string) (*Watcher, error)

func (*MetaDataWrapper) RemoveFlusher

func (s *MetaDataWrapper) RemoveFlusher(w *Watcher)

func (*MetaDataWrapper) Shutdown

func (s *MetaDataWrapper) Shutdown()

type PodResourceHandler

type PodResourceHandler struct {
	K8sResourceHandler
}

func (*PodResourceHandler) AddPod

func (prh *PodResourceHandler) AddPod(obj interface{})

func (*PodResourceHandler) DeleteObj

func (prh *PodResourceHandler) DeleteObj(obj interface{})

func (*PodResourceHandler) UpdatePod

func (prh *PodResourceHandler) UpdatePod(objOld interface{}, objNew interface{})

type Watcher

type Watcher struct {
	Id int32
	IP string

	*ioutil.WriteFlusher
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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