hook

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package hook is a generated GoMock package.

Index

Constants

View Source
const (
	SystemdActionType    = "systemd"
	ExecutableActionType = "executable"

	// FilePathKey is a placeholder which will be replaced with the file path
	FilePathKey = "FilePath"
)
View Source
const (
	DefaultHookActionTimeout = 10 * time.Second
)

Variables

View Source
var (
	ErrInvalidTokenFormat             = errors.New("invalid token: formatting")
	ErrTokenNotSupported              = errors.New("invalid token: not supported")
	ErrActionTypeNotFound             = errors.New("failed to find action type")
	ErrUnsupportedFilesystemOperation = errors.New("unsupported filesystem operation")
)

Functions

This section is empty.

Types

type ActionHook

type ActionHook interface {
	OnChange(ctx context.Context, path string) error
}

type ActionMap

type ActionMap map[string][]ActionHook

type Manager

type Manager interface {
	Run(ctx context.Context)
	Sync(current, desired *v1alpha1.RenderedDeviceSpec) error
	OnBeforeCreate(ctx context.Context, path string)
	OnAfterCreate(ctx context.Context, path string)
	OnBeforeUpdate(ctx context.Context, path string)
	OnAfterUpdate(ctx context.Context, path string)
	OnBeforeRemove(ctx context.Context, path string)
	OnAfterRemove(ctx context.Context, path string)
	Errors() []error
	Close() error
}

func NewManager

func NewManager(exec executer.Executer, log *log.PrefixLogger) Manager

type MockActionHook

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

MockActionHook is a mock of ActionHook interface.

func NewMockActionHook

func NewMockActionHook(ctrl *gomock.Controller) *MockActionHook

NewMockActionHook creates a new mock instance.

func (*MockActionHook) EXPECT

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

func (*MockActionHook) OnChange

func (m *MockActionHook) OnChange(ctx context.Context, path string) error

OnChange mocks base method.

type MockActionHookMockRecorder

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

MockActionHookMockRecorder is the mock recorder for MockActionHook.

func (*MockActionHookMockRecorder) OnChange

func (mr *MockActionHookMockRecorder) OnChange(ctx, path any) *gomock.Call

OnChange indicates an expected call of OnChange.

type MockManager

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

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) Close

func (m *MockManager) Close() error

Close mocks base method.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

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

func (*MockManager) Errors

func (m *MockManager) Errors() []error

Errors mocks base method.

func (*MockManager) OnAfterCreate

func (m *MockManager) OnAfterCreate(ctx context.Context, path string)

OnAfterCreate mocks base method.

func (*MockManager) OnAfterRemove

func (m *MockManager) OnAfterRemove(ctx context.Context, path string)

OnAfterRemove mocks base method.

func (*MockManager) OnAfterUpdate

func (m *MockManager) OnAfterUpdate(ctx context.Context, path string)

OnAfterUpdate mocks base method.

func (*MockManager) OnBeforeCreate

func (m *MockManager) OnBeforeCreate(ctx context.Context, path string)

OnBeforeCreate mocks base method.

func (*MockManager) OnBeforeRemove

func (m *MockManager) OnBeforeRemove(ctx context.Context, path string)

OnBeforeRemove mocks base method.

func (*MockManager) OnBeforeUpdate

func (m *MockManager) OnBeforeUpdate(ctx context.Context, path string)

OnBeforeUpdate mocks base method.

func (*MockManager) Run

func (m *MockManager) Run(ctx context.Context)

Run mocks base method.

func (*MockManager) Sync

func (m *MockManager) Sync(current, desired *v1alpha1.RenderedDeviceSpec) error

Sync mocks base method.

type MockManagerMockRecorder

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) Close

func (mr *MockManagerMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockManagerMockRecorder) Errors

func (mr *MockManagerMockRecorder) Errors() *gomock.Call

Errors indicates an expected call of Errors.

func (*MockManagerMockRecorder) OnAfterCreate

func (mr *MockManagerMockRecorder) OnAfterCreate(ctx, path any) *gomock.Call

OnAfterCreate indicates an expected call of OnAfterCreate.

func (*MockManagerMockRecorder) OnAfterRemove

func (mr *MockManagerMockRecorder) OnAfterRemove(ctx, path any) *gomock.Call

OnAfterRemove indicates an expected call of OnAfterRemove.

func (*MockManagerMockRecorder) OnAfterUpdate

func (mr *MockManagerMockRecorder) OnAfterUpdate(ctx, path any) *gomock.Call

OnAfterUpdate indicates an expected call of OnAfterUpdate.

func (*MockManagerMockRecorder) OnBeforeCreate

func (mr *MockManagerMockRecorder) OnBeforeCreate(ctx, path any) *gomock.Call

OnBeforeCreate indicates an expected call of OnBeforeCreate.

func (*MockManagerMockRecorder) OnBeforeRemove

func (mr *MockManagerMockRecorder) OnBeforeRemove(ctx, path any) *gomock.Call

OnBeforeRemove indicates an expected call of OnBeforeRemove.

func (*MockManagerMockRecorder) OnBeforeUpdate

func (mr *MockManagerMockRecorder) OnBeforeUpdate(ctx, path any) *gomock.Call

OnBeforeUpdate indicates an expected call of OnBeforeUpdate.

func (*MockManagerMockRecorder) Run

func (mr *MockManagerMockRecorder) Run(ctx any) *gomock.Call

Run indicates an expected call of Run.

func (*MockManagerMockRecorder) Sync

func (mr *MockManagerMockRecorder) Sync(current, desired any) *gomock.Call

Sync indicates an expected call of Sync.

Jump to

Keyboard shortcuts

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