health

package
v0.0.0-...-0514228 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package health is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownInformerType = errors.New("unknown health informer type")
)

Functions

This section is empty.

Types

type HealthInformer

type HealthInformer interface {
	// Start is non-blocking. It returns a channel that sends the health status of the local model when it changes.
	Start(ctx context.Context) <-chan HealthStatus
	// Register a model to the health informer. Resource is the resource that the model is running on.
	Register(ctx context.Context, model string, resource v1.ObjectReference)
	Unregister(ctx context.Context, model string)
	// Stop stops the health informer.
	Stop()
}

HealthInformer informs on the health of the source model.

func NewHealthInformer

func NewHealthInformer(ctx context.Context, restConfig *rest.Config, informerType HealthInformerType) (HealthInformer, error)

NewHealthInformer creates a new HealthInformer for a given type If the informer does not exist, it returns an error

type HealthInformerType

type HealthInformerType int
const (
	K8SHealthInformerType HealthInformerType = iota
)

type HealthStatus

type HealthStatus struct {
	ModelName string
	Healthy   bool
}

type MockHealthInformer

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

MockHealthInformer is a mock of HealthInformer interface.

func NewMockHealthInformer

func NewMockHealthInformer(ctrl *gomock.Controller) *MockHealthInformer

NewMockHealthInformer creates a new mock instance.

func (*MockHealthInformer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockHealthInformer) Register

func (m *MockHealthInformer) Register(ctx context.Context, model string, resource v1.ObjectReference)

Register mocks base method.

func (*MockHealthInformer) Start

func (m *MockHealthInformer) Start(ctx context.Context) <-chan HealthStatus

Start mocks base method.

func (*MockHealthInformer) Stop

func (m *MockHealthInformer) Stop()

Stop mocks base method.

func (*MockHealthInformer) Unregister

func (m *MockHealthInformer) Unregister(ctx context.Context, model string)

Unregister mocks base method.

type MockHealthInformerMockRecorder

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

MockHealthInformerMockRecorder is the mock recorder for MockHealthInformer.

func (*MockHealthInformerMockRecorder) Register

func (mr *MockHealthInformerMockRecorder) Register(ctx, model, resource any) *gomock.Call

Register indicates an expected call of Register.

func (*MockHealthInformerMockRecorder) Start

Start indicates an expected call of Start.

func (*MockHealthInformerMockRecorder) Stop

Stop indicates an expected call of Stop.

func (*MockHealthInformerMockRecorder) Unregister

func (mr *MockHealthInformerMockRecorder) Unregister(ctx, model any) *gomock.Call

Unregister indicates an expected call of Unregister.

Jump to

Keyboard shortcuts

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