From b10cec34978a3a4dce156886a79edd9c03689be2 Mon Sep 17 00:00:00 2001 From: sushant102004 Date: Tue, 12 Sep 2023 19:58:49 +0530 Subject: [PATCH] Made all command short description first letter capital --- cmd/cli/configure.go | 2 +- cmd/cli/kill.go | 2 +- cmd/cli/output.go | 2 +- cmd/cli/refresh.go | 2 +- cmd/cli/spawn.go | 2 +- mocks/internal_/layers/Backend.go | 297 -------------------------- mocks/internal_/layerstate/Backend.go | 290 ------------------------- mocks/internal_/storage/FileLike.go | 174 --------------- 8 files changed, 5 insertions(+), 766 deletions(-) delete mode 100644 mocks/internal_/layers/Backend.go delete mode 100644 mocks/internal_/layerstate/Backend.go delete mode 100644 mocks/internal_/storage/FileLike.go diff --git a/cmd/cli/configure.go b/cmd/cli/configure.go index ae5cf57..a38f69b 100644 --- a/cmd/cli/configure.go +++ b/cmd/cli/configure.go @@ -21,7 +21,7 @@ func init() { var configureCmd = &cobra.Command{ Use: "configure", - Short: "transforms layer definition configurations in an actual layer definition file", + Short: "Transforms layer definition configurations in an actual layer definition file", Long: `Transforms layer definition configurations in an actual layer definition file. This command is temporary. It will eventually be replaced by a Terraform provider. diff --git a/cmd/cli/kill.go b/cmd/cli/kill.go index e72ee2a..f67c088 100644 --- a/cmd/cli/kill.go +++ b/cmd/cli/kill.go @@ -22,7 +22,7 @@ func init() { var killCmd = &cobra.Command{ Use: "kill ", Args: cobra.MinimumNArgs(2), - Short: "destroys a layer instance", + Short: "Destroys a layer instance", Long: `The kill command destroys a layer instance. Please notice that the kill command cannot destroy a layer instance which has dependants. To delete a layer instance with dependants, you must first delete all of its dependants.`, diff --git a/cmd/cli/output.go b/cmd/cli/output.go index 759f8ad..4535364 100644 --- a/cmd/cli/output.go +++ b/cmd/cli/output.go @@ -22,7 +22,7 @@ func init() { var outputCmd = &cobra.Command{ Use: "output ", Args: cobra.MinimumNArgs(2), - Short: "reads all output variables from the provided layer instance", + Short: "Reads all output variables from the provided layer instance", Long: `The output command reads all output variables from the given layer instance and prints them as json to standard output.`, Run: func(cmd *cobra.Command, args []string) { logger := hclog.Default() diff --git a/cmd/cli/refresh.go b/cmd/cli/refresh.go index 960946c..fae802d 100644 --- a/cmd/cli/refresh.go +++ b/cmd/cli/refresh.go @@ -21,7 +21,7 @@ func init() { var refreshCmd = &cobra.Command{ Use: "refresh ", - Short: "refreshes a layer instance", + Short: "Refreshes a layer instance", Long: `The refresh command updates a layer instance. This command updates the layer instance resources to comply with the current version of the layer definition it belongs to, it also can be used to update values for the layer instance variables.`, diff --git a/cmd/cli/spawn.go b/cmd/cli/spawn.go index 807319c..c06af24 100644 --- a/cmd/cli/spawn.go +++ b/cmd/cli/spawn.go @@ -24,7 +24,7 @@ var alphanumericRegex = regexp.MustCompile("^[A-Za-z0-9][A-Za-z0-9_-]*[A-Za-z0-9 var spawnCmd = &cobra.Command{ Use: "spawn [desired_id]", - Short: "creates a layer instance", + Short: "Creates a layer instance", Long: `The spawn command creates a layer instance. Whenever a desired ID is not provided, Layerform will generate a random UUID for the layer instance. diff --git a/mocks/internal_/layers/Backend.go b/mocks/internal_/layers/Backend.go deleted file mode 100644 index 2899f2c..0000000 --- a/mocks/internal_/layers/Backend.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by mockery v2.32.2. DO NOT EDIT. - -package mocks - -import ( - context "context" - - data "github.com/ergomake/layerform/pkg/data" - - mock "github.com/stretchr/testify/mock" -) - -// Backend is an autogenerated mock type for the Backend type -type Backend struct { - mock.Mock -} - -type Backend_Expecter struct { - mock *mock.Mock -} - -func (_m *Backend) EXPECT() *Backend_Expecter { - return &Backend_Expecter{mock: &_m.Mock} -} - -// GetLayer provides a mock function with given fields: ctx, name -func (_m *Backend) GetLayer(ctx context.Context, name string) (*data.LayerDefinition, error) { - ret := _m.Called(ctx, name) - - var r0 *data.LayerDefinition - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*data.LayerDefinition, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *data.LayerDefinition); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*data.LayerDefinition) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Backend_GetLayer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLayer' -type Backend_GetLayer_Call struct { - *mock.Call -} - -// GetLayer is a helper method to define mock.On call -// - ctx context.Context -// - name string -func (_e *Backend_Expecter) GetLayer(ctx interface{}, name interface{}) *Backend_GetLayer_Call { - return &Backend_GetLayer_Call{Call: _e.mock.On("GetLayer", ctx, name)} -} - -func (_c *Backend_GetLayer_Call) Run(run func(ctx context.Context, name string)) *Backend_GetLayer_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *Backend_GetLayer_Call) Return(_a0 *data.LayerDefinition, _a1 error) *Backend_GetLayer_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Backend_GetLayer_Call) RunAndReturn(run func(context.Context, string) (*data.LayerDefinition, error)) *Backend_GetLayer_Call { - _c.Call.Return(run) - return _c -} - -// ListLayers provides a mock function with given fields: ctx -func (_m *Backend) ListLayers(ctx context.Context) ([]*data.LayerDefinition, error) { - ret := _m.Called(ctx) - - var r0 []*data.LayerDefinition - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]*data.LayerDefinition, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) []*data.LayerDefinition); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*data.LayerDefinition) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Backend_ListLayers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListLayers' -type Backend_ListLayers_Call struct { - *mock.Call -} - -// ListLayers is a helper method to define mock.On call -// - ctx context.Context -func (_e *Backend_Expecter) ListLayers(ctx interface{}) *Backend_ListLayers_Call { - return &Backend_ListLayers_Call{Call: _e.mock.On("ListLayers", ctx)} -} - -func (_c *Backend_ListLayers_Call) Run(run func(ctx context.Context)) *Backend_ListLayers_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *Backend_ListLayers_Call) Return(_a0 []*data.LayerDefinition, _a1 error) *Backend_ListLayers_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Backend_ListLayers_Call) RunAndReturn(run func(context.Context) ([]*data.LayerDefinition, error)) *Backend_ListLayers_Call { - _c.Call.Return(run) - return _c -} - -// Location provides a mock function with given fields: ctx -func (_m *Backend) Location(ctx context.Context) (string, error) { - ret := _m.Called(ctx) - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) string); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Backend_Location_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Location' -type Backend_Location_Call struct { - *mock.Call -} - -// Location is a helper method to define mock.On call -// - ctx context.Context -func (_e *Backend_Expecter) Location(ctx interface{}) *Backend_Location_Call { - return &Backend_Location_Call{Call: _e.mock.On("Location", ctx)} -} - -func (_c *Backend_Location_Call) Run(run func(ctx context.Context)) *Backend_Location_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *Backend_Location_Call) Return(_a0 string, _a1 error) *Backend_Location_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Backend_Location_Call) RunAndReturn(run func(context.Context) (string, error)) *Backend_Location_Call { - _c.Call.Return(run) - return _c -} - -// ResolveDependencies provides a mock function with given fields: ctx, layer -func (_m *Backend) ResolveDependencies(ctx context.Context, layer *data.LayerDefinition) ([]*data.LayerDefinition, error) { - ret := _m.Called(ctx, layer) - - var r0 []*data.LayerDefinition - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *data.LayerDefinition) ([]*data.LayerDefinition, error)); ok { - return rf(ctx, layer) - } - if rf, ok := ret.Get(0).(func(context.Context, *data.LayerDefinition) []*data.LayerDefinition); ok { - r0 = rf(ctx, layer) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*data.LayerDefinition) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *data.LayerDefinition) error); ok { - r1 = rf(ctx, layer) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Backend_ResolveDependencies_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveDependencies' -type Backend_ResolveDependencies_Call struct { - *mock.Call -} - -// ResolveDependencies is a helper method to define mock.On call -// - ctx context.Context -// - layer *data.Layer -func (_e *Backend_Expecter) ResolveDependencies(ctx interface{}, layer interface{}) *Backend_ResolveDependencies_Call { - return &Backend_ResolveDependencies_Call{Call: _e.mock.On("ResolveDependencies", ctx, layer)} -} - -func (_c *Backend_ResolveDependencies_Call) Run(run func(ctx context.Context, layer *data.LayerDefinition)) *Backend_ResolveDependencies_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*data.LayerDefinition)) - }) - return _c -} - -func (_c *Backend_ResolveDependencies_Call) Return(_a0 []*data.LayerDefinition, _a1 error) *Backend_ResolveDependencies_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Backend_ResolveDependencies_Call) RunAndReturn(run func(context.Context, *data.LayerDefinition) ([]*data.LayerDefinition, error)) *Backend_ResolveDependencies_Call { - _c.Call.Return(run) - return _c -} - -// UpdateLayers provides a mock function with given fields: ctx, _a1 -func (_m *Backend) UpdateLayers(ctx context.Context, _a1 []*data.LayerDefinition) error { - ret := _m.Called(ctx, _a1) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*data.LayerDefinition) error); ok { - r0 = rf(ctx, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Backend_UpdateLayers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateLayers' -type Backend_UpdateLayers_Call struct { - *mock.Call -} - -// UpdateLayers is a helper method to define mock.On call -// - ctx context.Context -// - _a1 []*data.Layer -func (_e *Backend_Expecter) UpdateLayers(ctx interface{}, _a1 interface{}) *Backend_UpdateLayers_Call { - return &Backend_UpdateLayers_Call{Call: _e.mock.On("UpdateLayers", ctx, _a1)} -} - -func (_c *Backend_UpdateLayers_Call) Run(run func(ctx context.Context, _a1 []*data.LayerDefinition)) *Backend_UpdateLayers_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].([]*data.LayerDefinition)) - }) - return _c -} - -func (_c *Backend_UpdateLayers_Call) Return(_a0 error) *Backend_UpdateLayers_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Backend_UpdateLayers_Call) RunAndReturn(run func(context.Context, []*data.LayerDefinition) error) *Backend_UpdateLayers_Call { - _c.Call.Return(run) - return _c -} - -// NewBackend creates a new instance of Backend. 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 NewBackend(t interface { - mock.TestingT - Cleanup(func()) -}) *Backend { - mock := &Backend{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/internal_/layerstate/Backend.go b/mocks/internal_/layerstate/Backend.go deleted file mode 100644 index a7ae014..0000000 --- a/mocks/internal_/layerstate/Backend.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by mockery v2.32.2. DO NOT EDIT. - -package mocks - -import ( - context "context" - - data "github.com/ergomake/layerform/pkg/data" - - mock "github.com/stretchr/testify/mock" -) - -// Backend is an autogenerated mock type for the Backend type -type Backend struct { - mock.Mock -} - -type Backend_Expecter struct { - mock *mock.Mock -} - -func (_m *Backend) EXPECT() *Backend_Expecter { - return &Backend_Expecter{mock: &_m.Mock} -} - -// DeleteState provides a mock function with given fields: ctx, layerName, stateName -func (_m *Backend) DeleteState(ctx context.Context, layerName string, stateName string) error { - ret := _m.Called(ctx, layerName, stateName) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, layerName, stateName) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Backend_DeleteState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteState' -type Backend_DeleteState_Call struct { - *mock.Call -} - -// DeleteState is a helper method to define mock.On call -// - ctx context.Context -// - layerName string -// - stateName string -func (_e *Backend_Expecter) DeleteState(ctx interface{}, layerName interface{}, stateName interface{}) *Backend_DeleteState_Call { - return &Backend_DeleteState_Call{Call: _e.mock.On("DeleteState", ctx, layerName, stateName)} -} - -func (_c *Backend_DeleteState_Call) Run(run func(ctx context.Context, layerName string, stateName string)) *Backend_DeleteState_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) - }) - return _c -} - -func (_c *Backend_DeleteState_Call) Return(_a0 error) *Backend_DeleteState_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Backend_DeleteState_Call) RunAndReturn(run func(context.Context, string, string) error) *Backend_DeleteState_Call { - _c.Call.Return(run) - return _c -} - -// GetState provides a mock function with given fields: ctx, layerName, stateName -func (_m *Backend) GetState(ctx context.Context, layerName string, stateName string) (*data.LayerInstance, error) { - ret := _m.Called(ctx, layerName, stateName) - - var r0 *data.LayerInstance - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*data.LayerInstance, error)); ok { - return rf(ctx, layerName, stateName) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *data.LayerInstance); ok { - r0 = rf(ctx, layerName, stateName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*data.LayerInstance) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, layerName, stateName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Backend_GetState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetState' -type Backend_GetState_Call struct { - *mock.Call -} - -// GetState is a helper method to define mock.On call -// - ctx context.Context -// - layerName string -// - stateName string -func (_e *Backend_Expecter) GetState(ctx interface{}, layerName interface{}, stateName interface{}) *Backend_GetState_Call { - return &Backend_GetState_Call{Call: _e.mock.On("GetState", ctx, layerName, stateName)} -} - -func (_c *Backend_GetState_Call) Run(run func(ctx context.Context, layerName string, stateName string)) *Backend_GetState_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) - }) - return _c -} - -func (_c *Backend_GetState_Call) Return(_a0 *data.LayerInstance, _a1 error) *Backend_GetState_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Backend_GetState_Call) RunAndReturn(run func(context.Context, string, string) (*data.LayerInstance, error)) *Backend_GetState_Call { - _c.Call.Return(run) - return _c -} - -// ListStates provides a mock function with given fields: ctx -func (_m *Backend) ListStates(ctx context.Context) ([]*data.LayerInstance, error) { - ret := _m.Called(ctx) - - var r0 []*data.LayerInstance - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]*data.LayerInstance, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) []*data.LayerInstance); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*data.LayerInstance) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Backend_ListStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListStates' -type Backend_ListStates_Call struct { - *mock.Call -} - -// ListStates is a helper method to define mock.On call -// - ctx context.Context -func (_e *Backend_Expecter) ListStates(ctx interface{}) *Backend_ListStates_Call { - return &Backend_ListStates_Call{Call: _e.mock.On("ListStates", ctx)} -} - -func (_c *Backend_ListStates_Call) Run(run func(ctx context.Context)) *Backend_ListStates_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *Backend_ListStates_Call) Return(_a0 []*data.LayerInstance, _a1 error) *Backend_ListStates_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Backend_ListStates_Call) RunAndReturn(run func(context.Context) ([]*data.LayerInstance, error)) *Backend_ListStates_Call { - _c.Call.Return(run) - return _c -} - -// ListStatesByLayer provides a mock function with given fields: ctx, layerName -func (_m *Backend) ListStatesByLayer(ctx context.Context, layerName string) ([]*data.LayerInstance, error) { - ret := _m.Called(ctx, layerName) - - var r0 []*data.LayerInstance - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]*data.LayerInstance, error)); ok { - return rf(ctx, layerName) - } - if rf, ok := ret.Get(0).(func(context.Context, string) []*data.LayerInstance); ok { - r0 = rf(ctx, layerName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*data.LayerInstance) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, layerName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Backend_ListStatesByLayer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListStatesByLayer' -type Backend_ListStatesByLayer_Call struct { - *mock.Call -} - -// ListStatesByLayer is a helper method to define mock.On call -// - ctx context.Context -// - layerName string -func (_e *Backend_Expecter) ListStatesByLayer(ctx interface{}, layerName interface{}) *Backend_ListStatesByLayer_Call { - return &Backend_ListStatesByLayer_Call{Call: _e.mock.On("ListStatesByLayer", ctx, layerName)} -} - -func (_c *Backend_ListStatesByLayer_Call) Run(run func(ctx context.Context, layerName string)) *Backend_ListStatesByLayer_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *Backend_ListStatesByLayer_Call) Return(_a0 []*data.LayerInstance, _a1 error) *Backend_ListStatesByLayer_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Backend_ListStatesByLayer_Call) RunAndReturn(run func(context.Context, string) ([]*data.LayerInstance, error)) *Backend_ListStatesByLayer_Call { - _c.Call.Return(run) - return _c -} - -// SaveState provides a mock function with given fields: ctx, state -func (_m *Backend) SaveState(ctx context.Context, state *data.LayerInstance) error { - ret := _m.Called(ctx, state) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *data.LayerInstance) error); ok { - r0 = rf(ctx, state) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Backend_SaveState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveState' -type Backend_SaveState_Call struct { - *mock.Call -} - -// SaveState is a helper method to define mock.On call -// - ctx context.Context -// - state *data.Instance -func (_e *Backend_Expecter) SaveState(ctx interface{}, state interface{}) *Backend_SaveState_Call { - return &Backend_SaveState_Call{Call: _e.mock.On("SaveState", ctx, state)} -} - -func (_c *Backend_SaveState_Call) Run(run func(ctx context.Context, state *data.LayerInstance)) *Backend_SaveState_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*data.LayerInstance)) - }) - return _c -} - -func (_c *Backend_SaveState_Call) Return(_a0 error) *Backend_SaveState_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Backend_SaveState_Call) RunAndReturn(run func(context.Context, *data.LayerInstance) error) *Backend_SaveState_Call { - _c.Call.Return(run) - return _c -} - -// NewBackend creates a new instance of Backend. 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 NewBackend(t interface { - mock.TestingT - Cleanup(func()) -}) *Backend { - mock := &Backend{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/internal_/storage/FileLike.go b/mocks/internal_/storage/FileLike.go deleted file mode 100644 index 92a0501..0000000 --- a/mocks/internal_/storage/FileLike.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by mockery v2.32.2. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" -) - -// FileLike is an autogenerated mock type for the FileLike type -type FileLike struct { - mock.Mock -} - -type FileLike_Expecter struct { - mock *mock.Mock -} - -func (_m *FileLike) EXPECT() *FileLike_Expecter { - return &FileLike_Expecter{mock: &_m.Mock} -} - -// Load provides a mock function with given fields: ctx, v -func (_m *FileLike) Load(ctx context.Context, v interface{}) error { - ret := _m.Called(ctx, v) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, interface{}) error); ok { - r0 = rf(ctx, v) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// FileLike_Load_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Load' -type FileLike_Load_Call struct { - *mock.Call -} - -// Load is a helper method to define mock.On call -// - ctx context.Context -// - v interface{} -func (_e *FileLike_Expecter) Load(ctx interface{}, v interface{}) *FileLike_Load_Call { - return &FileLike_Load_Call{Call: _e.mock.On("Load", ctx, v)} -} - -func (_c *FileLike_Load_Call) Run(run func(ctx context.Context, v interface{})) *FileLike_Load_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(interface{})) - }) - return _c -} - -func (_c *FileLike_Load_Call) Return(_a0 error) *FileLike_Load_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FileLike_Load_Call) RunAndReturn(run func(context.Context, interface{}) error) *FileLike_Load_Call { - _c.Call.Return(run) - return _c -} - -// Path provides a mock function with given fields: ctx -func (_m *FileLike) Path(ctx context.Context) (string, error) { - ret := _m.Called(ctx) - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) string); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// FileLike_Path_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Path' -type FileLike_Path_Call struct { - *mock.Call -} - -// Path is a helper method to define mock.On call -// - ctx context.Context -func (_e *FileLike_Expecter) Path(ctx interface{}) *FileLike_Path_Call { - return &FileLike_Path_Call{Call: _e.mock.On("Path", ctx)} -} - -func (_c *FileLike_Path_Call) Run(run func(ctx context.Context)) *FileLike_Path_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *FileLike_Path_Call) Return(_a0 string, _a1 error) *FileLike_Path_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *FileLike_Path_Call) RunAndReturn(run func(context.Context) (string, error)) *FileLike_Path_Call { - _c.Call.Return(run) - return _c -} - -// Save provides a mock function with given fields: ctx, v -func (_m *FileLike) Save(ctx context.Context, v interface{}) error { - ret := _m.Called(ctx, v) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, interface{}) error); ok { - r0 = rf(ctx, v) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// FileLike_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' -type FileLike_Save_Call struct { - *mock.Call -} - -// Save is a helper method to define mock.On call -// - ctx context.Context -// - v interface{} -func (_e *FileLike_Expecter) Save(ctx interface{}, v interface{}) *FileLike_Save_Call { - return &FileLike_Save_Call{Call: _e.mock.On("Save", ctx, v)} -} - -func (_c *FileLike_Save_Call) Run(run func(ctx context.Context, v interface{})) *FileLike_Save_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(interface{})) - }) - return _c -} - -func (_c *FileLike_Save_Call) Return(_a0 error) *FileLike_Save_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FileLike_Save_Call) RunAndReturn(run func(context.Context, interface{}) error) *FileLike_Save_Call { - _c.Call.Return(run) - return _c -} - -// NewFileLike creates a new instance of FileLike. 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 NewFileLike(t interface { - mock.TestingT - Cleanup(func()) -}) *FileLike { - mock := &FileLike{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -}