hook

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package hook is a generated GoMock package.

Index

Constants

View Source
const (
	// ReadOnlyConfigDir is where read-only configuration files are stored
	ReadOnlyConfigDir = "/usr/lib/flightctl"
	// ReadOnlyConfigDir is where read-only configuration files are stored
	UserWritableConfigDir = "/etc/flightctl"
	// HooksDropInDirName is the subdirectory in which hooks are stored
	HooksDropInDirName = "hooks.d"
)

TODO: Deduplicate with internal/agent/config.go after agreeing how to best break import cycles

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandLineVarKey added in v0.4.0

type CommandLineVarKey string
const (
	DefaultHookActionTimeout = 10 * time.Second

	// PathKey defines the name of the variable that contains the path operated on
	PathKey CommandLineVarKey = "Path"
	// FilesKey defines the name of the variable that contains a space-
	// separated list of files created, updated, or removed during the update
	FilesKey CommandLineVarKey = "Files"
	// CreatedKey defines the name of the variable that contains a space-
	// separated list of files created during the update
	CreatedKey CommandLineVarKey = "CreatedFiles"
	// UpdatedKey defines the name of the variable that contains a space-
	// separated list of files updated during the update
	UpdatedKey CommandLineVarKey = "UpdatedFiles"
	// RemovedKey defines the name of the variable that contains a space-
	// separated list of files removed during the update
	RemovedKey CommandLineVarKey = "RemovedFiles"
	// BackupKey defines the name of the variable that contains a space-
	// separated list of files backed up before removal from the system
	// into a temporary location deleted after the action completes.
	BackupKey CommandLineVarKey = "BackupFiles"
)

type Manager

type Manager interface {
	Sync(current, desired *api.DeviceSpec) error

	OnBeforeUpdating(ctx context.Context, current *api.DeviceSpec, desired *api.DeviceSpec) error
	OnAfterUpdating(ctx context.Context, current *api.DeviceSpec, desired *api.DeviceSpec, systemRebooted bool) error
	OnBeforeRebooting(ctx context.Context) error
	OnAfterRebooting(ctx context.Context) error
}

func NewManager

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

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) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

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

func (*MockManager) OnAfterRebooting added in v0.4.0

func (m *MockManager) OnAfterRebooting(ctx context.Context) error

OnAfterRebooting mocks base method.

func (*MockManager) OnAfterUpdating added in v0.4.0

func (m *MockManager) OnAfterUpdating(ctx context.Context, current, desired *v1alpha1.DeviceSpec, systemRebooted bool) error

OnAfterUpdating mocks base method.

func (*MockManager) OnBeforeRebooting added in v0.4.0

func (m *MockManager) OnBeforeRebooting(ctx context.Context) error

OnBeforeRebooting mocks base method.

func (*MockManager) OnBeforeUpdating added in v0.4.0

func (m *MockManager) OnBeforeUpdating(ctx context.Context, current, desired *v1alpha1.DeviceSpec) error

OnBeforeUpdating mocks base method.

func (*MockManager) Sync

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

Sync mocks base method.

type MockManagerMockRecorder

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) OnAfterRebooting added in v0.4.0

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

OnAfterRebooting indicates an expected call of OnAfterRebooting.

func (*MockManagerMockRecorder) OnAfterUpdating added in v0.4.0

func (mr *MockManagerMockRecorder) OnAfterUpdating(ctx, current, desired, systemRebooted any) *gomock.Call

OnAfterUpdating indicates an expected call of OnAfterUpdating.

func (*MockManagerMockRecorder) OnBeforeRebooting added in v0.4.0

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

OnBeforeRebooting indicates an expected call of OnBeforeRebooting.

func (*MockManagerMockRecorder) OnBeforeUpdating added in v0.4.0

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

OnBeforeUpdating indicates an expected call of OnBeforeUpdating.

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