reconcile

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package reconcile is a generated GoMock package.

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Context

type Context interface {
	// Ctx the Pipeline's context.Context that should be passed to any functions requiring a context
	Ctx() context.Context

	// Client provides the client that should be used for all k8s resource CRUD operations
	Client() client.Client

	// IsTypeSupported returns true if the GVK is supported on the kubernetes cluster
	IsTypeSupported(gvk schema.GroupVersionKind) bool

	// Log the request logger associated with the resource
	Log() logr.Logger

	// Requeue indicates that the pipeline should stop once the current Handler has finished execution and
	// reconciliation should be requeued
	Requeue(reason error)

	// RequeueAfter indicates that the pipeline should stop once the current Handler has finished execution and
	// reconciliation should be requeued after delay time
	RequeueAfter(delay time.Duration, reason error)

	// Status the current status of a pipeline execution
	Status() FlowStatus

	// StopProcessing indicates that the pipeline should stop once the current Handler has finished execution
	StopProcessing(err error)
}

Context of the pipeline, which is passed to each Handler

type ContextProvider

type ContextProvider interface {
	Get(i interface{}) (Context, error)
}

ContextProvider returns a Context implementation for a given resource type

type ContextProviderFunc

type ContextProviderFunc func(i interface{}) (Context, error)

func (ContextProviderFunc) Get

func (f ContextProviderFunc) Get(i interface{}) (Context, error)

type FlowStatus

type FlowStatus struct {
	Retry bool
	Stop  bool
	Err   error
	Delay time.Duration
}

FlowStatus Pipeline flow control

func (*FlowStatus) Requeue

func (f *FlowStatus) Requeue(err error)

func (*FlowStatus) RequeueAfter

func (f *FlowStatus) RequeueAfter(delay time.Duration, err error)

func (*FlowStatus) StopProcessing

func (f *FlowStatus) StopProcessing(err error)

func (*FlowStatus) String

func (f *FlowStatus) String() string

type Handler

type Handler interface {
	Handle(i interface{}, ctx Context)
}

Handler an individual stage in the pipeline

type HandlerFunc

type HandlerFunc func(i interface{}, ctx Context)

func (HandlerFunc) Handle

func (f HandlerFunc) Handle(i interface{}, ctx Context)

type MockContext

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

MockContext is a mock of Context interface.

func NewMockContext

func NewMockContext(ctrl *gomock.Controller) *MockContext

NewMockContext creates a new mock instance.

func (*MockContext) Client

func (m *MockContext) Client() client.Client

Client mocks base method.

func (*MockContext) Ctx

func (m *MockContext) Ctx() context.Context

Ctx mocks base method.

func (*MockContext) EXPECT

func (m *MockContext) EXPECT() *MockContextMockRecorder

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

func (*MockContext) IsTypeSupported

func (m *MockContext) IsTypeSupported(arg0 schema.GroupVersionKind) bool

IsTypeSupported mocks base method.

func (*MockContext) Log

func (m *MockContext) Log() logr.Logger

Log mocks base method.

func (*MockContext) Requeue

func (m *MockContext) Requeue(arg0 error)

Requeue mocks base method.

func (*MockContext) RequeueAfter

func (m *MockContext) RequeueAfter(arg0 time.Duration, arg1 error)

RequeueAfter mocks base method.

func (*MockContext) Status

func (m *MockContext) Status() FlowStatus

Status mocks base method.

func (*MockContext) StopProcessing

func (m *MockContext) StopProcessing(arg0 error)

StopProcessing mocks base method.

type MockContextMockRecorder

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

MockContextMockRecorder is the mock recorder for MockContext.

func (*MockContextMockRecorder) Client

func (mr *MockContextMockRecorder) Client() *gomock.Call

Client indicates an expected call of Client.

func (*MockContextMockRecorder) Ctx

func (mr *MockContextMockRecorder) Ctx() *gomock.Call

Ctx indicates an expected call of Ctx.

func (*MockContextMockRecorder) IsTypeSupported

func (mr *MockContextMockRecorder) IsTypeSupported(arg0 interface{}) *gomock.Call

IsTypeSupported indicates an expected call of IsTypeSupported.

func (*MockContextMockRecorder) Log

func (mr *MockContextMockRecorder) Log() *gomock.Call

Log indicates an expected call of Log.

func (*MockContextMockRecorder) Requeue

func (mr *MockContextMockRecorder) Requeue(arg0 interface{}) *gomock.Call

Requeue indicates an expected call of Requeue.

func (*MockContextMockRecorder) RequeueAfter

func (mr *MockContextMockRecorder) RequeueAfter(arg0, arg1 interface{}) *gomock.Call

RequeueAfter indicates an expected call of RequeueAfter.

func (*MockContextMockRecorder) Status

func (mr *MockContextMockRecorder) Status() *gomock.Call

Status indicates an expected call of Status.

func (*MockContextMockRecorder) StopProcessing

func (mr *MockContextMockRecorder) StopProcessing(arg0 interface{}) *gomock.Call

StopProcessing indicates an expected call of StopProcessing.

type MockContextProvider

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

MockContextProvider is a mock of ContextProvider interface.

func NewMockContextProvider

func NewMockContextProvider(ctrl *gomock.Controller) *MockContextProvider

NewMockContextProvider creates a new mock instance.

func (*MockContextProvider) EXPECT

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

func (*MockContextProvider) Get

func (m *MockContextProvider) Get(arg0 interface{}) (Context, error)

Get mocks base method.

type MockContextProviderMockRecorder

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

MockContextProviderMockRecorder is the mock recorder for MockContextProvider.

func (*MockContextProviderMockRecorder) Get

func (mr *MockContextProviderMockRecorder) Get(arg0 interface{}) *gomock.Call

Get indicates an expected call of Get.

type MockHandler

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

MockHandler is a mock of Handler interface.

func NewMockHandler

func NewMockHandler(ctrl *gomock.Controller) *MockHandler

NewMockHandler creates a new mock instance.

func (*MockHandler) EXPECT

func (m *MockHandler) EXPECT() *MockHandlerMockRecorder

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

func (*MockHandler) Handle

func (m *MockHandler) Handle(arg0 interface{}, arg1 Context)

Handle mocks base method.

type MockHandlerMockRecorder

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

MockHandlerMockRecorder is the mock recorder for MockHandler.

func (*MockHandlerMockRecorder) Handle

func (mr *MockHandlerMockRecorder) Handle(arg0, arg1 interface{}) *gomock.Call

Handle indicates an expected call of Handle.

type Pipeline

type Pipeline interface {
	// Process the pipeline
	// Returns true if processing should be repeated and optional error if occurred
	// important: even if error occurred it might not be needed to retry processing
	Process(i interface{}) (bool, time.Duration, error)
}

Pipeline for resource reconciliation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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