actions

package
v0.0.0-...-45fb69a Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateHash

func CalculateHash(filename string, prevHash string) (string, error)

Types

type Actions

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

func New

func New(ExecutionLogger ExecutionLogger, DefinitionReaderWriter MigrationDefinitionReaderWriter) *Actions

func (*Actions) RecalculateHashes

func (a *Actions) RecalculateHashes(folder string) error

func (*Actions) Run

func (a *Actions) Run(folder string) error

func (*Actions) Verify

func (a *Actions) Verify(folder string) (bool, error)

type ExecutionLogger

type ExecutionLogger interface {
	LogExecution([]StepResult) error
	LoadExecutionLog() (ExecutionLogs, error)
}

type ExecutionLoggerMock

type ExecutionLoggerMock struct {
	mock.Mock
}

ExecutionLoggerMock is an autogenerated mock type for the ExecutionLogger type

func NewExecutionLoggerMock

func NewExecutionLoggerMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *ExecutionLoggerMock

NewExecutionLoggerMock creates a new instance of ExecutionLoggerMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*ExecutionLoggerMock) EXPECT

func (*ExecutionLoggerMock) LoadExecutionLog

func (_m *ExecutionLoggerMock) LoadExecutionLog() (ExecutionLogs, error)

LoadExecutionLog provides a mock function with no fields

func (*ExecutionLoggerMock) LogExecution

func (_m *ExecutionLoggerMock) LogExecution(_a0 []StepResult) error

LogExecution provides a mock function with given fields: _a0

type ExecutionLoggerMock_Expecter

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

func (*ExecutionLoggerMock_Expecter) LoadExecutionLog

LoadExecutionLog is a helper method to define mock.On call

func (*ExecutionLoggerMock_Expecter) LogExecution

func (_e *ExecutionLoggerMock_Expecter) LogExecution(_a0 interface{}) *ExecutionLoggerMock_LogExecution_Call

LogExecution is a helper method to define mock.On call

  • _a0 []StepResult

type ExecutionLoggerMock_LoadExecutionLog_Call

type ExecutionLoggerMock_LoadExecutionLog_Call struct {
	*mock.Call
}

ExecutionLoggerMock_LoadExecutionLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadExecutionLog'

func (*ExecutionLoggerMock_LoadExecutionLog_Call) Return

func (*ExecutionLoggerMock_LoadExecutionLog_Call) Run

func (*ExecutionLoggerMock_LoadExecutionLog_Call) RunAndReturn

type ExecutionLoggerMock_LogExecution_Call

type ExecutionLoggerMock_LogExecution_Call struct {
	*mock.Call
}

ExecutionLoggerMock_LogExecution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogExecution'

func (*ExecutionLoggerMock_LogExecution_Call) Return

func (*ExecutionLoggerMock_LogExecution_Call) Run

func (*ExecutionLoggerMock_LogExecution_Call) RunAndReturn

type ExecutionLogs

type ExecutionLogs struct {
	Steps []StepResult `yaml:"steps"`
}

type MigrationDefinition

type MigrationDefinition struct {
	Steps []MigrationStep `yaml:"steps"`
}

type MigrationDefinitionReaderWriter

type MigrationDefinitionReaderWriter interface {
	Read(fileName string) (MigrationDefinition, error)
	Write(fileName string, vales MigrationDefinition) error
}

type MigrationDefinitionReaderWriterMock

type MigrationDefinitionReaderWriterMock struct {
	mock.Mock
}

MigrationDefinitionReaderWriterMock is an autogenerated mock type for the MigrationDefinitionReaderWriter type

func NewMigrationDefinitionReaderWriterMock

func NewMigrationDefinitionReaderWriterMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *MigrationDefinitionReaderWriterMock

NewMigrationDefinitionReaderWriterMock creates a new instance of MigrationDefinitionReaderWriterMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MigrationDefinitionReaderWriterMock) EXPECT

func (*MigrationDefinitionReaderWriterMock) Read

Read provides a mock function with given fields: fileName

func (*MigrationDefinitionReaderWriterMock) Write

Write provides a mock function with given fields: fileName, vales

type MigrationDefinitionReaderWriterMock_Expecter

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

func (*MigrationDefinitionReaderWriterMock_Expecter) Read

Read is a helper method to define mock.On call

  • fileName string

func (*MigrationDefinitionReaderWriterMock_Expecter) Write

func (_e *MigrationDefinitionReaderWriterMock_Expecter) Write(fileName interface{}, vales interface{}) *MigrationDefinitionReaderWriterMock_Write_Call

Write is a helper method to define mock.On call

  • fileName string
  • vales MigrationDefinition

type MigrationDefinitionReaderWriterMock_Read_Call

type MigrationDefinitionReaderWriterMock_Read_Call struct {
	*mock.Call
}

MigrationDefinitionReaderWriterMock_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'

func (*MigrationDefinitionReaderWriterMock_Read_Call) Return

func (*MigrationDefinitionReaderWriterMock_Read_Call) Run

func (*MigrationDefinitionReaderWriterMock_Read_Call) RunAndReturn

type MigrationDefinitionReaderWriterMock_Write_Call

type MigrationDefinitionReaderWriterMock_Write_Call struct {
	*mock.Call
}

MigrationDefinitionReaderWriterMock_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'

func (*MigrationDefinitionReaderWriterMock_Write_Call) Return

func (*MigrationDefinitionReaderWriterMock_Write_Call) Run

func (*MigrationDefinitionReaderWriterMock_Write_Call) RunAndReturn

type MigrationStep

type MigrationStep struct {
	Filename    string `yaml:"filename"`
	Description string `yaml:"description"`
	Hash        string `yaml:"hash"`
}

type StepResult

type StepResult struct {
	Timestamp time.Time `yaml:"timestamp"`
	Hash      string    `yaml:"hash"`
}

type YamlReaderWriterMock

type YamlReaderWriterMock[T any] struct {
	mock.Mock
}

YamlReaderWriterMock is an autogenerated mock type for the YamlReaderWriter type

func NewYamlReaderWriterMock

func NewYamlReaderWriterMock[T any](t interface {
	mock.TestingT
	Cleanup(func())
}) *YamlReaderWriterMock[T]

NewYamlReaderWriterMock creates a new instance of YamlReaderWriterMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*YamlReaderWriterMock[T]) EXPECT

func (*YamlReaderWriterMock[T]) Read

func (_m *YamlReaderWriterMock[T]) Read(fileName string) (T, error)

Read provides a mock function with given fields: fileName

func (*YamlReaderWriterMock[T]) Write

func (_m *YamlReaderWriterMock[T]) Write(fileName string, vales T) error

Write provides a mock function with given fields: fileName, vales

type YamlReaderWriterMock_Expecter

type YamlReaderWriterMock_Expecter[T any] struct {
	// contains filtered or unexported fields
}

func (*YamlReaderWriterMock_Expecter[T]) Read

func (_e *YamlReaderWriterMock_Expecter[T]) Read(fileName interface{}) *YamlReaderWriterMock_Read_Call[T]

Read is a helper method to define mock.On call

  • fileName string

func (*YamlReaderWriterMock_Expecter[T]) Write

func (_e *YamlReaderWriterMock_Expecter[T]) Write(fileName interface{}, vales interface{}) *YamlReaderWriterMock_Write_Call[T]

Write is a helper method to define mock.On call

  • fileName string
  • vales T

type YamlReaderWriterMock_Read_Call

type YamlReaderWriterMock_Read_Call[T any] struct {
	*mock.Call
}

YamlReaderWriterMock_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'

func (*YamlReaderWriterMock_Read_Call[T]) Return

func (*YamlReaderWriterMock_Read_Call[T]) Run

func (_c *YamlReaderWriterMock_Read_Call[T]) Run(run func(fileName string)) *YamlReaderWriterMock_Read_Call[T]

func (*YamlReaderWriterMock_Read_Call[T]) RunAndReturn

func (_c *YamlReaderWriterMock_Read_Call[T]) RunAndReturn(run func(string) (T, error)) *YamlReaderWriterMock_Read_Call[T]

type YamlReaderWriterMock_Write_Call

type YamlReaderWriterMock_Write_Call[T any] struct {
	*mock.Call
}

YamlReaderWriterMock_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'

func (*YamlReaderWriterMock_Write_Call[T]) Return

func (*YamlReaderWriterMock_Write_Call[T]) Run

func (_c *YamlReaderWriterMock_Write_Call[T]) Run(run func(fileName string, vales T)) *YamlReaderWriterMock_Write_Call[T]

func (*YamlReaderWriterMock_Write_Call[T]) RunAndReturn

func (_c *YamlReaderWriterMock_Write_Call[T]) RunAndReturn(run func(string, T) error) *YamlReaderWriterMock_Write_Call[T]

Jump to

Keyboard shortcuts

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