Internal state persistence (#27)
Badges / coveralls (push) Successful in 1m4s

Allow us to generate year over year reports without having to rerun everything from the beginning.

Co-authored-by: Natercio Moniz <[email protected]>
This commit was merged in pull request #27.
This commit is contained in:
2026-08-03 00:33:06 +01:00
committed by natercio
parent 1ce8561782
commit 9bd4230ff1
25 changed files with 1726 additions and 178 deletions
+230 -2
View File
@@ -1,9 +1,9 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/nmoniz/any2anexoj/internal (interfaces: RecordReader,Record,ReportWriter)
// Source: github.com/nmoniz/any2anexoj/internal (interfaces: RecordReader,Record,ReportWriter,RecordEncoder,RecordDecoder,RecordSerializer)
//
// Generated by this command:
//
// mockgen -destination=mocks/mocks_gen.go -package=mocks -typed . RecordReader,Record,ReportWriter
// mockgen -destination=mocks/mocks_gen.go -package=mocks -typed . RecordReader,Record,ReportWriter,RecordEncoder,RecordDecoder,RecordSerializer
//
// Package mocks is a generated GoMock package.
@@ -547,3 +547,231 @@ func (c *MockReportWriterWriteCall) DoAndReturn(f func(context.Context, internal
c.Call = c.Call.DoAndReturn(f)
return c
}
// MockRecordEncoder is a mock of RecordEncoder interface.
type MockRecordEncoder struct {
ctrl *gomock.Controller
recorder *MockRecordEncoderMockRecorder
isgomock struct{}
}
// MockRecordEncoderMockRecorder is the mock recorder for MockRecordEncoder.
type MockRecordEncoderMockRecorder struct {
mock *MockRecordEncoder
}
// NewMockRecordEncoder creates a new mock instance.
func NewMockRecordEncoder(ctrl *gomock.Controller) *MockRecordEncoder {
mock := &MockRecordEncoder{ctrl: ctrl}
mock.recorder = &MockRecordEncoderMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockRecordEncoder) EXPECT() *MockRecordEncoderMockRecorder {
return m.recorder
}
// MarshalRecord mocks base method.
func (m *MockRecordEncoder) MarshalRecord(arg0 context.Context, arg1 internal.Record) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MarshalRecord", arg0, arg1)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MarshalRecord indicates an expected call of MarshalRecord.
func (mr *MockRecordEncoderMockRecorder) MarshalRecord(arg0, arg1 any) *MockRecordEncoderMarshalRecordCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarshalRecord", reflect.TypeOf((*MockRecordEncoder)(nil).MarshalRecord), arg0, arg1)
return &MockRecordEncoderMarshalRecordCall{Call: call}
}
// MockRecordEncoderMarshalRecordCall wrap *gomock.Call
type MockRecordEncoderMarshalRecordCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockRecordEncoderMarshalRecordCall) Return(arg0 []byte, arg1 error) *MockRecordEncoderMarshalRecordCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockRecordEncoderMarshalRecordCall) Do(f func(context.Context, internal.Record) ([]byte, error)) *MockRecordEncoderMarshalRecordCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockRecordEncoderMarshalRecordCall) DoAndReturn(f func(context.Context, internal.Record) ([]byte, error)) *MockRecordEncoderMarshalRecordCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// MockRecordDecoder is a mock of RecordDecoder interface.
type MockRecordDecoder struct {
ctrl *gomock.Controller
recorder *MockRecordDecoderMockRecorder
isgomock struct{}
}
// MockRecordDecoderMockRecorder is the mock recorder for MockRecordDecoder.
type MockRecordDecoderMockRecorder struct {
mock *MockRecordDecoder
}
// NewMockRecordDecoder creates a new mock instance.
func NewMockRecordDecoder(ctrl *gomock.Controller) *MockRecordDecoder {
mock := &MockRecordDecoder{ctrl: ctrl}
mock.recorder = &MockRecordDecoderMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockRecordDecoder) EXPECT() *MockRecordDecoderMockRecorder {
return m.recorder
}
// UnmarshalRecord mocks base method.
func (m *MockRecordDecoder) UnmarshalRecord(arg0 context.Context, arg1 []byte) (internal.Record, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UnmarshalRecord", arg0, arg1)
ret0, _ := ret[0].(internal.Record)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UnmarshalRecord indicates an expected call of UnmarshalRecord.
func (mr *MockRecordDecoderMockRecorder) UnmarshalRecord(arg0, arg1 any) *MockRecordDecoderUnmarshalRecordCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnmarshalRecord", reflect.TypeOf((*MockRecordDecoder)(nil).UnmarshalRecord), arg0, arg1)
return &MockRecordDecoderUnmarshalRecordCall{Call: call}
}
// MockRecordDecoderUnmarshalRecordCall wrap *gomock.Call
type MockRecordDecoderUnmarshalRecordCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockRecordDecoderUnmarshalRecordCall) Return(arg0 internal.Record, arg1 error) *MockRecordDecoderUnmarshalRecordCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockRecordDecoderUnmarshalRecordCall) Do(f func(context.Context, []byte) (internal.Record, error)) *MockRecordDecoderUnmarshalRecordCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockRecordDecoderUnmarshalRecordCall) DoAndReturn(f func(context.Context, []byte) (internal.Record, error)) *MockRecordDecoderUnmarshalRecordCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// MockRecordSerializer is a mock of RecordSerializer interface.
type MockRecordSerializer struct {
ctrl *gomock.Controller
recorder *MockRecordSerializerMockRecorder
isgomock struct{}
}
// MockRecordSerializerMockRecorder is the mock recorder for MockRecordSerializer.
type MockRecordSerializerMockRecorder struct {
mock *MockRecordSerializer
}
// NewMockRecordSerializer creates a new mock instance.
func NewMockRecordSerializer(ctrl *gomock.Controller) *MockRecordSerializer {
mock := &MockRecordSerializer{ctrl: ctrl}
mock.recorder = &MockRecordSerializerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockRecordSerializer) EXPECT() *MockRecordSerializerMockRecorder {
return m.recorder
}
// MarshalRecord mocks base method.
func (m *MockRecordSerializer) MarshalRecord(arg0 context.Context, arg1 internal.Record) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "MarshalRecord", arg0, arg1)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// MarshalRecord indicates an expected call of MarshalRecord.
func (mr *MockRecordSerializerMockRecorder) MarshalRecord(arg0, arg1 any) *MockRecordSerializerMarshalRecordCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarshalRecord", reflect.TypeOf((*MockRecordSerializer)(nil).MarshalRecord), arg0, arg1)
return &MockRecordSerializerMarshalRecordCall{Call: call}
}
// MockRecordSerializerMarshalRecordCall wrap *gomock.Call
type MockRecordSerializerMarshalRecordCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockRecordSerializerMarshalRecordCall) Return(arg0 []byte, arg1 error) *MockRecordSerializerMarshalRecordCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockRecordSerializerMarshalRecordCall) Do(f func(context.Context, internal.Record) ([]byte, error)) *MockRecordSerializerMarshalRecordCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockRecordSerializerMarshalRecordCall) DoAndReturn(f func(context.Context, internal.Record) ([]byte, error)) *MockRecordSerializerMarshalRecordCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// UnmarshalRecord mocks base method.
func (m *MockRecordSerializer) UnmarshalRecord(arg0 context.Context, arg1 []byte) (internal.Record, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UnmarshalRecord", arg0, arg1)
ret0, _ := ret[0].(internal.Record)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// UnmarshalRecord indicates an expected call of UnmarshalRecord.
func (mr *MockRecordSerializerMockRecorder) UnmarshalRecord(arg0, arg1 any) *MockRecordSerializerUnmarshalRecordCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnmarshalRecord", reflect.TypeOf((*MockRecordSerializer)(nil).UnmarshalRecord), arg0, arg1)
return &MockRecordSerializerUnmarshalRecordCall{Call: call}
}
// MockRecordSerializerUnmarshalRecordCall wrap *gomock.Call
type MockRecordSerializerUnmarshalRecordCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockRecordSerializerUnmarshalRecordCall) Return(arg0 internal.Record, arg1 error) *MockRecordSerializerUnmarshalRecordCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockRecordSerializerUnmarshalRecordCall) Do(f func(context.Context, []byte) (internal.Record, error)) *MockRecordSerializerUnmarshalRecordCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockRecordSerializerUnmarshalRecordCall) DoAndReturn(f func(context.Context, []byte) (internal.Record, error)) *MockRecordSerializerUnmarshalRecordCall {
c.Call = c.Call.DoAndReturn(f)
return c
}