diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9848d08 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,49 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at . All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version +[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and +[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md), +and was generated by [contributing-gen](https://github.com/bttger/contributing-gen). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..009b6fe --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,111 @@ +# Contributing to spine-go + +First off, thanks for taking the time to contribute! ❤️ + +All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 + +## Table of Contents + +- [Discussions and Questions](#discussions-and-questions) +- [Bug Reports](#bug-reports) +- [New Feature Requests](#new-feature-requests) +- [Issue Tracker](#issue-tracker) +- [Pull Requests](#pull-requests) +- [Styleguides](#styleguides) + +## Discussions and Questions + +For discussions, questions, feature requests, or ideas, [start a new discussion](https://github.com/enbility/spine-go/discussions/new) in the spine-go repository under the Discussions tab. + +Before you ask a question, it is best to search for existing [Discussions](https://github.com/enbility/spine-go/discussions) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. + +If you then still feel the need to ask a question and need clarification, we recommend the following: + +- Open an [Discussion](https://github.com/enbility/spine-go/discussions/new/choose). +- Provide as much context as you can about what you're running into. + +## Bug Reports + +### Before Submitting a Bug Report + +A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. + +- Make sure that you are using the latest version. +- Determine if your bug is really a bug and not an error on your side. +- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/enbility/spine-go/issues?q=label%3Abug). +- Collect information about the bug: + - Stack trace + - If possible and relevant, the `trace` log of the SHIP and SPINE communication + - Possibly your input and the output + - Can you reliably reproduce the issue? And can you also reproduce it with older versions? + +### How Do I Submit a Good Bug Report? + +> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . + +We use GitHub issues to track bugs and errors. If you run into an issue with the project: + +- Open an [Issue](https://github.com/enbility/spine-go/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) +- Explain the behavior you would expect and the actual behavior. +- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. + +## New Feature Requests + +This section guides you through submitting an enhancement suggestion for spine-go, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. + +### Before Submitting an Enhancement + +- Make sure that you are using the latest version. +- Check the api interfaces carefully and find out if the functionality is already covered. +- Perform a [discussion search](https://github.com/enbility/spine-go/discussions) to see if the enhancement has already been suggested. If it has, add a comment to the existing discussion instead of opening a new one. +- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. + +### How Do I Submit a Good Enhancement Suggestion? + +Enhancement suggestions are tracked as [Discussions](https://github.com/enbility/spine-go/discussions). + +- Use a **clear and descriptive title** for the issue to identify the suggestion. +- Provide a **step-by-step description of the suggested enhancement** in as many details as possible. +- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. +- **Explain why this enhancement would be useful**. You may also want to point out the other projects that solved it better and which could serve as inspiration. + +## Issue Tracker + +The [Issue Tracker](https://github.com/enbility/spine-go/issues) is used to discuss bug fixes and details for improvements once they agreed on as [Discussions](https://github.com/enbility/spine-go/discussions). + +- Use a **clear and descriptive title** for the issue to identify the suggestion. +- The issue should describe the intent of the change. +- Provide a link to the discussion (if available) that this issue is based on +- Provide a **step-by-step description of the suggested enhancement** in as many details as possible. + +## Pull Requests + +> ### Legal Notice +> +> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. + +We recommend creating your pull-request as a "draft" and to commit early and often so the community can give you feedback at the beginning of the process as opposed to asking you to change hours of hard work at the end. + +- Describe the contribution. First document which issue number was fixed. Then describe the contribution. +- Associated coverage unit tests should be provided. +- Provide the expected behavior changes of the pull request. +- Provide any additional context if applicable. +- Verify that the PR passes all workflow checks. If you expect some of these checks to fail. Please note it in the Pull Request text or comments. + +### Fix for whitespace, format code, or make a purely cosmetic patch? + +Changes that are cosmetic in nature and do not add anything substantial to the stability, functionality, or testability of spine-go will generally not be accepted. + +### Do you want to add a new feature or change an existing one? + +- Suggest your change in the [Discussions](https://github.com/enbility/spine-go/discussions) +- Do not open an issue on GitHub until you have collected positive feedback about the change. GitHub issues are primarily intended for bug reports, fixes, and enhancement detail discussions. + +## Styleguides + +- The project uses [golangci-lint](https://golangci-lint.run) +- It is a goal to cover as much code as possible with at least one test case and don't decrease test coverage noticably + +## Attribution + +This guide is based on the **contributing.md**. [Make your own](https://contributing.md/)! diff --git a/api/entity.go b/api/entity.go index dcfcc63..2cada4a 100644 --- a/api/entity.go +++ b/api/entity.go @@ -49,12 +49,12 @@ type EntityLocalInterface interface { scenarios []model.UseCaseScenarioSupportType, ) // Check if a use case is already added - HasUseCaseSupport(model.UseCaseFilter) bool + HasUseCaseSupport(model.UseCaseFilterType) bool // Remove one or multiple usecases - RemoveUseCaseSupports([]model.UseCaseFilter) + RemoveUseCaseSupports([]model.UseCaseFilterType) // Set the availability of a usecase. This may only be used for usescases // that act as a client within the usecase! - SetUseCaseAvailability(filter model.UseCaseFilter, available bool) + SetUseCaseAvailability(filter model.UseCaseFilterType, available bool) // Remove all usecases RemoveAllUseCaseSupports() diff --git a/mocks/EntityLocalInterface.go b/mocks/EntityLocalInterface.go index 4edecb5..9049080 100644 --- a/mocks/EntityLocalInterface.go +++ b/mocks/EntityLocalInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.45.0. DO NOT EDIT. +// Code generated by mockery v2.46.3. DO NOT EDIT. package mocks @@ -473,7 +473,7 @@ func (_c *EntityLocalInterface_GetOrAddFeature_Call) RunAndReturn(run func(model } // HasUseCaseSupport provides a mock function with given fields: _a0 -func (_m *EntityLocalInterface) HasUseCaseSupport(_a0 model.UseCaseFilter) bool { +func (_m *EntityLocalInterface) HasUseCaseSupport(_a0 model.UseCaseFilterType) bool { ret := _m.Called(_a0) if len(ret) == 0 { @@ -481,7 +481,7 @@ func (_m *EntityLocalInterface) HasUseCaseSupport(_a0 model.UseCaseFilter) bool } var r0 bool - if rf, ok := ret.Get(0).(func(model.UseCaseFilter) bool); ok { + if rf, ok := ret.Get(0).(func(model.UseCaseFilterType) bool); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(bool) @@ -496,14 +496,14 @@ type EntityLocalInterface_HasUseCaseSupport_Call struct { } // HasUseCaseSupport is a helper method to define mock.On call -// - _a0 model.UseCaseFilter +// - _a0 model.UseCaseFilterType func (_e *EntityLocalInterface_Expecter) HasUseCaseSupport(_a0 interface{}) *EntityLocalInterface_HasUseCaseSupport_Call { return &EntityLocalInterface_HasUseCaseSupport_Call{Call: _e.mock.On("HasUseCaseSupport", _a0)} } -func (_c *EntityLocalInterface_HasUseCaseSupport_Call) Run(run func(_a0 model.UseCaseFilter)) *EntityLocalInterface_HasUseCaseSupport_Call { +func (_c *EntityLocalInterface_HasUseCaseSupport_Call) Run(run func(_a0 model.UseCaseFilterType)) *EntityLocalInterface_HasUseCaseSupport_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.UseCaseFilter)) + run(args[0].(model.UseCaseFilterType)) }) return _c } @@ -513,7 +513,7 @@ func (_c *EntityLocalInterface_HasUseCaseSupport_Call) Return(_a0 bool) *EntityL return _c } -func (_c *EntityLocalInterface_HasUseCaseSupport_Call) RunAndReturn(run func(model.UseCaseFilter) bool) *EntityLocalInterface_HasUseCaseSupport_Call { +func (_c *EntityLocalInterface_HasUseCaseSupport_Call) RunAndReturn(run func(model.UseCaseFilterType) bool) *EntityLocalInterface_HasUseCaseSupport_Call { _c.Call.Return(run) return _c } @@ -754,7 +754,7 @@ func (_c *EntityLocalInterface_RemoveAllUseCaseSupports_Call) RunAndReturn(run f } // RemoveUseCaseSupports provides a mock function with given fields: _a0 -func (_m *EntityLocalInterface) RemoveUseCaseSupports(_a0 []model.UseCaseFilter) { +func (_m *EntityLocalInterface) RemoveUseCaseSupports(_a0 []model.UseCaseFilterType) { _m.Called(_a0) } @@ -764,14 +764,14 @@ type EntityLocalInterface_RemoveUseCaseSupports_Call struct { } // RemoveUseCaseSupports is a helper method to define mock.On call -// - _a0 []model.UseCaseFilter +// - _a0 []model.UseCaseFilterType func (_e *EntityLocalInterface_Expecter) RemoveUseCaseSupports(_a0 interface{}) *EntityLocalInterface_RemoveUseCaseSupports_Call { return &EntityLocalInterface_RemoveUseCaseSupports_Call{Call: _e.mock.On("RemoveUseCaseSupports", _a0)} } -func (_c *EntityLocalInterface_RemoveUseCaseSupports_Call) Run(run func(_a0 []model.UseCaseFilter)) *EntityLocalInterface_RemoveUseCaseSupports_Call { +func (_c *EntityLocalInterface_RemoveUseCaseSupports_Call) Run(run func(_a0 []model.UseCaseFilterType)) *EntityLocalInterface_RemoveUseCaseSupports_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]model.UseCaseFilter)) + run(args[0].([]model.UseCaseFilterType)) }) return _c } @@ -781,7 +781,7 @@ func (_c *EntityLocalInterface_RemoveUseCaseSupports_Call) Return() *EntityLocal return _c } -func (_c *EntityLocalInterface_RemoveUseCaseSupports_Call) RunAndReturn(run func([]model.UseCaseFilter)) *EntityLocalInterface_RemoveUseCaseSupports_Call { +func (_c *EntityLocalInterface_RemoveUseCaseSupports_Call) RunAndReturn(run func([]model.UseCaseFilterType)) *EntityLocalInterface_RemoveUseCaseSupports_Call { _c.Call.Return(run) return _c } @@ -820,7 +820,7 @@ func (_c *EntityLocalInterface_SetDescription_Call) RunAndReturn(run func(*model } // SetUseCaseAvailability provides a mock function with given fields: filter, available -func (_m *EntityLocalInterface) SetUseCaseAvailability(filter model.UseCaseFilter, available bool) { +func (_m *EntityLocalInterface) SetUseCaseAvailability(filter model.UseCaseFilterType, available bool) { _m.Called(filter, available) } @@ -830,15 +830,15 @@ type EntityLocalInterface_SetUseCaseAvailability_Call struct { } // SetUseCaseAvailability is a helper method to define mock.On call -// - filter model.UseCaseFilter +// - filter model.UseCaseFilterType // - available bool func (_e *EntityLocalInterface_Expecter) SetUseCaseAvailability(filter interface{}, available interface{}) *EntityLocalInterface_SetUseCaseAvailability_Call { return &EntityLocalInterface_SetUseCaseAvailability_Call{Call: _e.mock.On("SetUseCaseAvailability", filter, available)} } -func (_c *EntityLocalInterface_SetUseCaseAvailability_Call) Run(run func(filter model.UseCaseFilter, available bool)) *EntityLocalInterface_SetUseCaseAvailability_Call { +func (_c *EntityLocalInterface_SetUseCaseAvailability_Call) Run(run func(filter model.UseCaseFilterType, available bool)) *EntityLocalInterface_SetUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.UseCaseFilter), args[1].(bool)) + run(args[0].(model.UseCaseFilterType), args[1].(bool)) }) return _c } @@ -848,7 +848,7 @@ func (_c *EntityLocalInterface_SetUseCaseAvailability_Call) Return() *EntityLoca return _c } -func (_c *EntityLocalInterface_SetUseCaseAvailability_Call) RunAndReturn(run func(model.UseCaseFilter, bool)) *EntityLocalInterface_SetUseCaseAvailability_Call { +func (_c *EntityLocalInterface_SetUseCaseAvailability_Call) RunAndReturn(run func(model.UseCaseFilterType, bool)) *EntityLocalInterface_SetUseCaseAvailability_Call { _c.Call.Return(run) return _c } diff --git a/mocks/FeatureLocalInterface.go b/mocks/FeatureLocalInterface.go index d864da7..2717357 100644 --- a/mocks/FeatureLocalInterface.go +++ b/mocks/FeatureLocalInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.45.0. DO NOT EDIT. +// Code generated by mockery v2.46.3. DO NOT EDIT. package mocks @@ -426,19 +426,19 @@ func (_c *FeatureLocalInterface_CleanWriteApprovalCaches_Call) RunAndReturn(run } // DataCopy provides a mock function with given fields: function -func (_m *FeatureLocalInterface) DataCopy(function model.FunctionType) interface{} { +func (_m *FeatureLocalInterface) DataCopy(function model.FunctionType) any { ret := _m.Called(function) if len(ret) == 0 { panic("no return value specified for DataCopy") } - var r0 interface{} - if rf, ok := ret.Get(0).(func(model.FunctionType) interface{}); ok { + var r0 any + if rf, ok := ret.Get(0).(func(model.FunctionType) any); ok { r0 = rf(function) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) + r0 = ret.Get(0).(any) } } @@ -463,12 +463,12 @@ func (_c *FeatureLocalInterface_DataCopy_Call) Run(run func(function model.Funct return _c } -func (_c *FeatureLocalInterface_DataCopy_Call) Return(_a0 interface{}) *FeatureLocalInterface_DataCopy_Call { +func (_c *FeatureLocalInterface_DataCopy_Call) Return(_a0 any) *FeatureLocalInterface_DataCopy_Call { _c.Call.Return(_a0) return _c } -func (_c *FeatureLocalInterface_DataCopy_Call) RunAndReturn(run func(model.FunctionType) interface{}) *FeatureLocalInterface_DataCopy_Call { +func (_c *FeatureLocalInterface_DataCopy_Call) RunAndReturn(run func(model.FunctionType) any) *FeatureLocalInterface_DataCopy_Call { _c.Call.Return(run) return _c } @@ -1080,7 +1080,7 @@ func (_c *FeatureLocalInterface_RemoveRemoteSubscription_Call) RunAndReturn(run } // RequestRemoteData provides a mock function with given fields: function, selector, elements, destination -func (_m *FeatureLocalInterface) RequestRemoteData(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { +func (_m *FeatureLocalInterface) RequestRemoteData(function model.FunctionType, selector any, elements any, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { ret := _m.Called(function, selector, elements, destination) if len(ret) == 0 { @@ -1089,10 +1089,10 @@ func (_m *FeatureLocalInterface) RequestRemoteData(function model.FunctionType, var r0 *model.MsgCounterType var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { + if rf, ok := ret.Get(0).(func(model.FunctionType, any, any, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { return rf(function, selector, elements, destination) } - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) *model.MsgCounterType); ok { + if rf, ok := ret.Get(0).(func(model.FunctionType, any, any, api.FeatureRemoteInterface) *model.MsgCounterType); ok { r0 = rf(function, selector, elements, destination) } else { if ret.Get(0) != nil { @@ -1100,7 +1100,7 @@ func (_m *FeatureLocalInterface) RequestRemoteData(function model.FunctionType, } } - if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) *model.ErrorType); ok { + if rf, ok := ret.Get(1).(func(model.FunctionType, any, any, api.FeatureRemoteInterface) *model.ErrorType); ok { r1 = rf(function, selector, elements, destination) } else { if ret.Get(1) != nil { @@ -1118,16 +1118,16 @@ type FeatureLocalInterface_RequestRemoteData_Call struct { // RequestRemoteData is a helper method to define mock.On call // - function model.FunctionType -// - selector interface{} -// - elements interface{} +// - selector any +// - elements any // - destination api.FeatureRemoteInterface func (_e *FeatureLocalInterface_Expecter) RequestRemoteData(function interface{}, selector interface{}, elements interface{}, destination interface{}) *FeatureLocalInterface_RequestRemoteData_Call { return &FeatureLocalInterface_RequestRemoteData_Call{Call: _e.mock.On("RequestRemoteData", function, selector, elements, destination)} } -func (_c *FeatureLocalInterface_RequestRemoteData_Call) Run(run func(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemoteInterface)) *FeatureLocalInterface_RequestRemoteData_Call { +func (_c *FeatureLocalInterface_RequestRemoteData_Call) Run(run func(function model.FunctionType, selector any, elements any, destination api.FeatureRemoteInterface)) *FeatureLocalInterface_RequestRemoteData_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(api.FeatureRemoteInterface)) + run(args[0].(model.FunctionType), args[1].(any), args[2].(any), args[3].(api.FeatureRemoteInterface)) }) return _c } @@ -1137,7 +1137,7 @@ func (_c *FeatureLocalInterface_RequestRemoteData_Call) Return(_a0 *model.MsgCou return _c } -func (_c *FeatureLocalInterface_RequestRemoteData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocalInterface_RequestRemoteData_Call { +func (_c *FeatureLocalInterface_RequestRemoteData_Call) RunAndReturn(run func(model.FunctionType, any, any, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocalInterface_RequestRemoteData_Call { _c.Call.Return(run) return _c } @@ -1252,7 +1252,7 @@ func (_c *FeatureLocalInterface_Role_Call) RunAndReturn(run func() model.RoleTyp } // SetData provides a mock function with given fields: function, data -func (_m *FeatureLocalInterface) SetData(function model.FunctionType, data interface{}) { +func (_m *FeatureLocalInterface) SetData(function model.FunctionType, data any) { _m.Called(function, data) } @@ -1263,14 +1263,14 @@ type FeatureLocalInterface_SetData_Call struct { // SetData is a helper method to define mock.On call // - function model.FunctionType -// - data interface{} +// - data any func (_e *FeatureLocalInterface_Expecter) SetData(function interface{}, data interface{}) *FeatureLocalInterface_SetData_Call { return &FeatureLocalInterface_SetData_Call{Call: _e.mock.On("SetData", function, data)} } -func (_c *FeatureLocalInterface_SetData_Call) Run(run func(function model.FunctionType, data interface{})) *FeatureLocalInterface_SetData_Call { +func (_c *FeatureLocalInterface_SetData_Call) Run(run func(function model.FunctionType, data any)) *FeatureLocalInterface_SetData_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{})) + run(args[0].(model.FunctionType), args[1].(any)) }) return _c } @@ -1280,7 +1280,7 @@ func (_c *FeatureLocalInterface_SetData_Call) Return() *FeatureLocalInterface_Se return _c } -func (_c *FeatureLocalInterface_SetData_Call) RunAndReturn(run func(model.FunctionType, interface{})) *FeatureLocalInterface_SetData_Call { +func (_c *FeatureLocalInterface_SetData_Call) RunAndReturn(run func(model.FunctionType, any)) *FeatureLocalInterface_SetData_Call { _c.Call.Return(run) return _c } @@ -1535,7 +1535,7 @@ func (_c *FeatureLocalInterface_Type_Call) RunAndReturn(run func() model.Feature } // UpdateData provides a mock function with given fields: function, data, filterPartial, filterDelete -func (_m *FeatureLocalInterface) UpdateData(function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) *model.ErrorType { +func (_m *FeatureLocalInterface) UpdateData(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) *model.ErrorType { ret := _m.Called(function, data, filterPartial, filterDelete) if len(ret) == 0 { @@ -1543,7 +1543,7 @@ func (_m *FeatureLocalInterface) UpdateData(function model.FunctionType, data in } var r0 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, *model.FilterType, *model.FilterType) *model.ErrorType); ok { + if rf, ok := ret.Get(0).(func(model.FunctionType, any, *model.FilterType, *model.FilterType) *model.ErrorType); ok { r0 = rf(function, data, filterPartial, filterDelete) } else { if ret.Get(0) != nil { @@ -1561,16 +1561,16 @@ type FeatureLocalInterface_UpdateData_Call struct { // UpdateData is a helper method to define mock.On call // - function model.FunctionType -// - data interface{} +// - data any // - filterPartial *model.FilterType // - filterDelete *model.FilterType func (_e *FeatureLocalInterface_Expecter) UpdateData(function interface{}, data interface{}, filterPartial interface{}, filterDelete interface{}) *FeatureLocalInterface_UpdateData_Call { return &FeatureLocalInterface_UpdateData_Call{Call: _e.mock.On("UpdateData", function, data, filterPartial, filterDelete)} } -func (_c *FeatureLocalInterface_UpdateData_Call) Run(run func(function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FeatureLocalInterface_UpdateData_Call { +func (_c *FeatureLocalInterface_UpdateData_Call) Run(run func(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FeatureLocalInterface_UpdateData_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(*model.FilterType), args[3].(*model.FilterType)) + run(args[0].(model.FunctionType), args[1].(any), args[2].(*model.FilterType), args[3].(*model.FilterType)) }) return _c } @@ -1580,7 +1580,7 @@ func (_c *FeatureLocalInterface_UpdateData_Call) Return(_a0 *model.ErrorType) *F return _c } -func (_c *FeatureLocalInterface_UpdateData_Call) RunAndReturn(run func(model.FunctionType, interface{}, *model.FilterType, *model.FilterType) *model.ErrorType) *FeatureLocalInterface_UpdateData_Call { +func (_c *FeatureLocalInterface_UpdateData_Call) RunAndReturn(run func(model.FunctionType, any, *model.FilterType, *model.FilterType) *model.ErrorType) *FeatureLocalInterface_UpdateData_Call { _c.Call.Return(run) return _c } diff --git a/mocks/FeatureRemoteInterface.go b/mocks/FeatureRemoteInterface.go index dcb4418..c1306ee 100644 --- a/mocks/FeatureRemoteInterface.go +++ b/mocks/FeatureRemoteInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.45.0. DO NOT EDIT. +// Code generated by mockery v2.46.3. DO NOT EDIT. package mocks @@ -72,19 +72,19 @@ func (_c *FeatureRemoteInterface_Address_Call) RunAndReturn(run func() *model.Fe } // DataCopy provides a mock function with given fields: function -func (_m *FeatureRemoteInterface) DataCopy(function model.FunctionType) interface{} { +func (_m *FeatureRemoteInterface) DataCopy(function model.FunctionType) any { ret := _m.Called(function) if len(ret) == 0 { panic("no return value specified for DataCopy") } - var r0 interface{} - if rf, ok := ret.Get(0).(func(model.FunctionType) interface{}); ok { + var r0 any + if rf, ok := ret.Get(0).(func(model.FunctionType) any); ok { r0 = rf(function) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) + r0 = ret.Get(0).(any) } } @@ -109,12 +109,12 @@ func (_c *FeatureRemoteInterface_DataCopy_Call) Run(run func(function model.Func return _c } -func (_c *FeatureRemoteInterface_DataCopy_Call) Return(_a0 interface{}) *FeatureRemoteInterface_DataCopy_Call { +func (_c *FeatureRemoteInterface_DataCopy_Call) Return(_a0 any) *FeatureRemoteInterface_DataCopy_Call { _c.Call.Return(_a0) return _c } -func (_c *FeatureRemoteInterface_DataCopy_Call) RunAndReturn(run func(model.FunctionType) interface{}) *FeatureRemoteInterface_DataCopy_Call { +func (_c *FeatureRemoteInterface_DataCopy_Call) RunAndReturn(run func(model.FunctionType) any) *FeatureRemoteInterface_DataCopy_Call { _c.Call.Return(run) return _c } @@ -620,27 +620,27 @@ func (_c *FeatureRemoteInterface_Type_Call) RunAndReturn(run func() model.Featur } // UpdateData provides a mock function with given fields: persist, function, data, filterPartial, filterDelete -func (_m *FeatureRemoteInterface) UpdateData(persist bool, function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) (interface{}, *model.ErrorType) { +func (_m *FeatureRemoteInterface) UpdateData(persist bool, function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) (any, *model.ErrorType) { ret := _m.Called(persist, function, data, filterPartial, filterDelete) if len(ret) == 0 { panic("no return value specified for UpdateData") } - var r0 interface{} + var r0 any var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(bool, model.FunctionType, interface{}, *model.FilterType, *model.FilterType) (interface{}, *model.ErrorType)); ok { + if rf, ok := ret.Get(0).(func(bool, model.FunctionType, any, *model.FilterType, *model.FilterType) (any, *model.ErrorType)); ok { return rf(persist, function, data, filterPartial, filterDelete) } - if rf, ok := ret.Get(0).(func(bool, model.FunctionType, interface{}, *model.FilterType, *model.FilterType) interface{}); ok { + if rf, ok := ret.Get(0).(func(bool, model.FunctionType, any, *model.FilterType, *model.FilterType) any); ok { r0 = rf(persist, function, data, filterPartial, filterDelete) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) + r0 = ret.Get(0).(any) } } - if rf, ok := ret.Get(1).(func(bool, model.FunctionType, interface{}, *model.FilterType, *model.FilterType) *model.ErrorType); ok { + if rf, ok := ret.Get(1).(func(bool, model.FunctionType, any, *model.FilterType, *model.FilterType) *model.ErrorType); ok { r1 = rf(persist, function, data, filterPartial, filterDelete) } else { if ret.Get(1) != nil { @@ -659,26 +659,26 @@ type FeatureRemoteInterface_UpdateData_Call struct { // UpdateData is a helper method to define mock.On call // - persist bool // - function model.FunctionType -// - data interface{} +// - data any // - filterPartial *model.FilterType // - filterDelete *model.FilterType func (_e *FeatureRemoteInterface_Expecter) UpdateData(persist interface{}, function interface{}, data interface{}, filterPartial interface{}, filterDelete interface{}) *FeatureRemoteInterface_UpdateData_Call { return &FeatureRemoteInterface_UpdateData_Call{Call: _e.mock.On("UpdateData", persist, function, data, filterPartial, filterDelete)} } -func (_c *FeatureRemoteInterface_UpdateData_Call) Run(run func(persist bool, function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FeatureRemoteInterface_UpdateData_Call { +func (_c *FeatureRemoteInterface_UpdateData_Call) Run(run func(persist bool, function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FeatureRemoteInterface_UpdateData_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(bool), args[1].(model.FunctionType), args[2].(interface{}), args[3].(*model.FilterType), args[4].(*model.FilterType)) + run(args[0].(bool), args[1].(model.FunctionType), args[2].(any), args[3].(*model.FilterType), args[4].(*model.FilterType)) }) return _c } -func (_c *FeatureRemoteInterface_UpdateData_Call) Return(_a0 interface{}, _a1 *model.ErrorType) *FeatureRemoteInterface_UpdateData_Call { +func (_c *FeatureRemoteInterface_UpdateData_Call) Return(_a0 any, _a1 *model.ErrorType) *FeatureRemoteInterface_UpdateData_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *FeatureRemoteInterface_UpdateData_Call) RunAndReturn(run func(bool, model.FunctionType, interface{}, *model.FilterType, *model.FilterType) (interface{}, *model.ErrorType)) *FeatureRemoteInterface_UpdateData_Call { +func (_c *FeatureRemoteInterface_UpdateData_Call) RunAndReturn(run func(bool, model.FunctionType, any, *model.FilterType, *model.FilterType) (any, *model.ErrorType)) *FeatureRemoteInterface_UpdateData_Call { _c.Call.Return(run) return _c } diff --git a/mocks/FunctionDataCmdInterface.go b/mocks/FunctionDataCmdInterface.go index 469ac59..8e8a868 100644 --- a/mocks/FunctionDataCmdInterface.go +++ b/mocks/FunctionDataCmdInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.45.0. DO NOT EDIT. +// Code generated by mockery v2.46.3. DO NOT EDIT. package mocks @@ -21,19 +21,19 @@ func (_m *FunctionDataCmdInterface) EXPECT() *FunctionDataCmdInterface_Expecter } // DataCopyAny provides a mock function with given fields: -func (_m *FunctionDataCmdInterface) DataCopyAny() interface{} { +func (_m *FunctionDataCmdInterface) DataCopyAny() any { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for DataCopyAny") } - var r0 interface{} - if rf, ok := ret.Get(0).(func() interface{}); ok { + var r0 any + if rf, ok := ret.Get(0).(func() any); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) + r0 = ret.Get(0).(any) } } @@ -57,12 +57,12 @@ func (_c *FunctionDataCmdInterface_DataCopyAny_Call) Run(run func()) *FunctionDa return _c } -func (_c *FunctionDataCmdInterface_DataCopyAny_Call) Return(_a0 interface{}) *FunctionDataCmdInterface_DataCopyAny_Call { +func (_c *FunctionDataCmdInterface_DataCopyAny_Call) Return(_a0 any) *FunctionDataCmdInterface_DataCopyAny_Call { _c.Call.Return(_a0) return _c } -func (_c *FunctionDataCmdInterface_DataCopyAny_Call) RunAndReturn(run func() interface{}) *FunctionDataCmdInterface_DataCopyAny_Call { +func (_c *FunctionDataCmdInterface_DataCopyAny_Call) RunAndReturn(run func() any) *FunctionDataCmdInterface_DataCopyAny_Call { _c.Call.Return(run) return _c } @@ -113,7 +113,7 @@ func (_c *FunctionDataCmdInterface_FunctionType_Call) RunAndReturn(run func() mo } // NotifyOrWriteCmdType provides a mock function with given fields: deleteSelector, partialSelector, partialWithoutSelector, deleteElements -func (_m *FunctionDataCmdInterface) NotifyOrWriteCmdType(deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}) model.CmdType { +func (_m *FunctionDataCmdInterface) NotifyOrWriteCmdType(deleteSelector any, partialSelector any, partialWithoutSelector bool, deleteElements any) model.CmdType { ret := _m.Called(deleteSelector, partialSelector, partialWithoutSelector, deleteElements) if len(ret) == 0 { @@ -121,7 +121,7 @@ func (_m *FunctionDataCmdInterface) NotifyOrWriteCmdType(deleteSelector interfac } var r0 model.CmdType - if rf, ok := ret.Get(0).(func(interface{}, interface{}, bool, interface{}) model.CmdType); ok { + if rf, ok := ret.Get(0).(func(any, any, bool, any) model.CmdType); ok { r0 = rf(deleteSelector, partialSelector, partialWithoutSelector, deleteElements) } else { r0 = ret.Get(0).(model.CmdType) @@ -136,17 +136,17 @@ type FunctionDataCmdInterface_NotifyOrWriteCmdType_Call struct { } // NotifyOrWriteCmdType is a helper method to define mock.On call -// - deleteSelector interface{} -// - partialSelector interface{} +// - deleteSelector any +// - partialSelector any // - partialWithoutSelector bool -// - deleteElements interface{} +// - deleteElements any func (_e *FunctionDataCmdInterface_Expecter) NotifyOrWriteCmdType(deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector interface{}, deleteElements interface{}) *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call { return &FunctionDataCmdInterface_NotifyOrWriteCmdType_Call{Call: _e.mock.On("NotifyOrWriteCmdType", deleteSelector, partialSelector, partialWithoutSelector, deleteElements)} } -func (_c *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call) Run(run func(deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{})) *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call { +func (_c *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call) Run(run func(deleteSelector any, partialSelector any, partialWithoutSelector bool, deleteElements any)) *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{}), args[1].(interface{}), args[2].(bool), args[3].(interface{})) + run(args[0].(any), args[1].(any), args[2].(bool), args[3].(any)) }) return _c } @@ -156,13 +156,13 @@ func (_c *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call) Return(_a0 model.C return _c } -func (_c *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call) RunAndReturn(run func(interface{}, interface{}, bool, interface{}) model.CmdType) *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call { +func (_c *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call) RunAndReturn(run func(any, any, bool, any) model.CmdType) *FunctionDataCmdInterface_NotifyOrWriteCmdType_Call { _c.Call.Return(run) return _c } // ReadCmdType provides a mock function with given fields: partialSelector, elements -func (_m *FunctionDataCmdInterface) ReadCmdType(partialSelector interface{}, elements interface{}) model.CmdType { +func (_m *FunctionDataCmdInterface) ReadCmdType(partialSelector any, elements any) model.CmdType { ret := _m.Called(partialSelector, elements) if len(ret) == 0 { @@ -170,7 +170,7 @@ func (_m *FunctionDataCmdInterface) ReadCmdType(partialSelector interface{}, ele } var r0 model.CmdType - if rf, ok := ret.Get(0).(func(interface{}, interface{}) model.CmdType); ok { + if rf, ok := ret.Get(0).(func(any, any) model.CmdType); ok { r0 = rf(partialSelector, elements) } else { r0 = ret.Get(0).(model.CmdType) @@ -185,15 +185,15 @@ type FunctionDataCmdInterface_ReadCmdType_Call struct { } // ReadCmdType is a helper method to define mock.On call -// - partialSelector interface{} -// - elements interface{} +// - partialSelector any +// - elements any func (_e *FunctionDataCmdInterface_Expecter) ReadCmdType(partialSelector interface{}, elements interface{}) *FunctionDataCmdInterface_ReadCmdType_Call { return &FunctionDataCmdInterface_ReadCmdType_Call{Call: _e.mock.On("ReadCmdType", partialSelector, elements)} } -func (_c *FunctionDataCmdInterface_ReadCmdType_Call) Run(run func(partialSelector interface{}, elements interface{})) *FunctionDataCmdInterface_ReadCmdType_Call { +func (_c *FunctionDataCmdInterface_ReadCmdType_Call) Run(run func(partialSelector any, elements any)) *FunctionDataCmdInterface_ReadCmdType_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{}), args[1].(interface{})) + run(args[0].(any), args[1].(any)) }) return _c } @@ -203,7 +203,7 @@ func (_c *FunctionDataCmdInterface_ReadCmdType_Call) Return(_a0 model.CmdType) * return _c } -func (_c *FunctionDataCmdInterface_ReadCmdType_Call) RunAndReturn(run func(interface{}, interface{}) model.CmdType) *FunctionDataCmdInterface_ReadCmdType_Call { +func (_c *FunctionDataCmdInterface_ReadCmdType_Call) RunAndReturn(run func(any, any) model.CmdType) *FunctionDataCmdInterface_ReadCmdType_Call { _c.Call.Return(run) return _c } @@ -300,27 +300,27 @@ func (_c *FunctionDataCmdInterface_SupportsPartialWrite_Call) RunAndReturn(run f } // UpdateDataAny provides a mock function with given fields: remoteWrite, persist, data, filterPartial, filterDelete -func (_m *FunctionDataCmdInterface) UpdateDataAny(remoteWrite bool, persist bool, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) (interface{}, *model.ErrorType) { +func (_m *FunctionDataCmdInterface) UpdateDataAny(remoteWrite bool, persist bool, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) (any, *model.ErrorType) { ret := _m.Called(remoteWrite, persist, data, filterPartial, filterDelete) if len(ret) == 0 { panic("no return value specified for UpdateDataAny") } - var r0 interface{} + var r0 any var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(bool, bool, interface{}, *model.FilterType, *model.FilterType) (interface{}, *model.ErrorType)); ok { + if rf, ok := ret.Get(0).(func(bool, bool, any, *model.FilterType, *model.FilterType) (any, *model.ErrorType)); ok { return rf(remoteWrite, persist, data, filterPartial, filterDelete) } - if rf, ok := ret.Get(0).(func(bool, bool, interface{}, *model.FilterType, *model.FilterType) interface{}); ok { + if rf, ok := ret.Get(0).(func(bool, bool, any, *model.FilterType, *model.FilterType) any); ok { r0 = rf(remoteWrite, persist, data, filterPartial, filterDelete) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) + r0 = ret.Get(0).(any) } } - if rf, ok := ret.Get(1).(func(bool, bool, interface{}, *model.FilterType, *model.FilterType) *model.ErrorType); ok { + if rf, ok := ret.Get(1).(func(bool, bool, any, *model.FilterType, *model.FilterType) *model.ErrorType); ok { r1 = rf(remoteWrite, persist, data, filterPartial, filterDelete) } else { if ret.Get(1) != nil { @@ -339,26 +339,26 @@ type FunctionDataCmdInterface_UpdateDataAny_Call struct { // UpdateDataAny is a helper method to define mock.On call // - remoteWrite bool // - persist bool -// - data interface{} +// - data any // - filterPartial *model.FilterType // - filterDelete *model.FilterType func (_e *FunctionDataCmdInterface_Expecter) UpdateDataAny(remoteWrite interface{}, persist interface{}, data interface{}, filterPartial interface{}, filterDelete interface{}) *FunctionDataCmdInterface_UpdateDataAny_Call { return &FunctionDataCmdInterface_UpdateDataAny_Call{Call: _e.mock.On("UpdateDataAny", remoteWrite, persist, data, filterPartial, filterDelete)} } -func (_c *FunctionDataCmdInterface_UpdateDataAny_Call) Run(run func(remoteWrite bool, persist bool, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FunctionDataCmdInterface_UpdateDataAny_Call { +func (_c *FunctionDataCmdInterface_UpdateDataAny_Call) Run(run func(remoteWrite bool, persist bool, data any, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FunctionDataCmdInterface_UpdateDataAny_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(bool), args[1].(bool), args[2].(interface{}), args[3].(*model.FilterType), args[4].(*model.FilterType)) + run(args[0].(bool), args[1].(bool), args[2].(any), args[3].(*model.FilterType), args[4].(*model.FilterType)) }) return _c } -func (_c *FunctionDataCmdInterface_UpdateDataAny_Call) Return(_a0 interface{}, _a1 *model.ErrorType) *FunctionDataCmdInterface_UpdateDataAny_Call { +func (_c *FunctionDataCmdInterface_UpdateDataAny_Call) Return(_a0 any, _a1 *model.ErrorType) *FunctionDataCmdInterface_UpdateDataAny_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *FunctionDataCmdInterface_UpdateDataAny_Call) RunAndReturn(run func(bool, bool, interface{}, *model.FilterType, *model.FilterType) (interface{}, *model.ErrorType)) *FunctionDataCmdInterface_UpdateDataAny_Call { +func (_c *FunctionDataCmdInterface_UpdateDataAny_Call) RunAndReturn(run func(bool, bool, any, *model.FilterType, *model.FilterType) (any, *model.ErrorType)) *FunctionDataCmdInterface_UpdateDataAny_Call { _c.Call.Return(run) return _c } diff --git a/mocks/FunctionDataInterface.go b/mocks/FunctionDataInterface.go index 0041b85..c0c1a77 100644 --- a/mocks/FunctionDataInterface.go +++ b/mocks/FunctionDataInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.45.0. DO NOT EDIT. +// Code generated by mockery v2.46.3. DO NOT EDIT. package mocks @@ -21,19 +21,19 @@ func (_m *FunctionDataInterface) EXPECT() *FunctionDataInterface_Expecter { } // DataCopyAny provides a mock function with given fields: -func (_m *FunctionDataInterface) DataCopyAny() interface{} { +func (_m *FunctionDataInterface) DataCopyAny() any { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for DataCopyAny") } - var r0 interface{} - if rf, ok := ret.Get(0).(func() interface{}); ok { + var r0 any + if rf, ok := ret.Get(0).(func() any); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) + r0 = ret.Get(0).(any) } } @@ -57,12 +57,12 @@ func (_c *FunctionDataInterface_DataCopyAny_Call) Run(run func()) *FunctionDataI return _c } -func (_c *FunctionDataInterface_DataCopyAny_Call) Return(_a0 interface{}) *FunctionDataInterface_DataCopyAny_Call { +func (_c *FunctionDataInterface_DataCopyAny_Call) Return(_a0 any) *FunctionDataInterface_DataCopyAny_Call { _c.Call.Return(_a0) return _c } -func (_c *FunctionDataInterface_DataCopyAny_Call) RunAndReturn(run func() interface{}) *FunctionDataInterface_DataCopyAny_Call { +func (_c *FunctionDataInterface_DataCopyAny_Call) RunAndReturn(run func() any) *FunctionDataInterface_DataCopyAny_Call { _c.Call.Return(run) return _c } @@ -158,27 +158,27 @@ func (_c *FunctionDataInterface_SupportsPartialWrite_Call) RunAndReturn(run func } // UpdateDataAny provides a mock function with given fields: remoteWrite, persist, data, filterPartial, filterDelete -func (_m *FunctionDataInterface) UpdateDataAny(remoteWrite bool, persist bool, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) (interface{}, *model.ErrorType) { +func (_m *FunctionDataInterface) UpdateDataAny(remoteWrite bool, persist bool, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) (any, *model.ErrorType) { ret := _m.Called(remoteWrite, persist, data, filterPartial, filterDelete) if len(ret) == 0 { panic("no return value specified for UpdateDataAny") } - var r0 interface{} + var r0 any var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(bool, bool, interface{}, *model.FilterType, *model.FilterType) (interface{}, *model.ErrorType)); ok { + if rf, ok := ret.Get(0).(func(bool, bool, any, *model.FilterType, *model.FilterType) (any, *model.ErrorType)); ok { return rf(remoteWrite, persist, data, filterPartial, filterDelete) } - if rf, ok := ret.Get(0).(func(bool, bool, interface{}, *model.FilterType, *model.FilterType) interface{}); ok { + if rf, ok := ret.Get(0).(func(bool, bool, any, *model.FilterType, *model.FilterType) any); ok { r0 = rf(remoteWrite, persist, data, filterPartial, filterDelete) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) + r0 = ret.Get(0).(any) } } - if rf, ok := ret.Get(1).(func(bool, bool, interface{}, *model.FilterType, *model.FilterType) *model.ErrorType); ok { + if rf, ok := ret.Get(1).(func(bool, bool, any, *model.FilterType, *model.FilterType) *model.ErrorType); ok { r1 = rf(remoteWrite, persist, data, filterPartial, filterDelete) } else { if ret.Get(1) != nil { @@ -197,26 +197,26 @@ type FunctionDataInterface_UpdateDataAny_Call struct { // UpdateDataAny is a helper method to define mock.On call // - remoteWrite bool // - persist bool -// - data interface{} +// - data any // - filterPartial *model.FilterType // - filterDelete *model.FilterType func (_e *FunctionDataInterface_Expecter) UpdateDataAny(remoteWrite interface{}, persist interface{}, data interface{}, filterPartial interface{}, filterDelete interface{}) *FunctionDataInterface_UpdateDataAny_Call { return &FunctionDataInterface_UpdateDataAny_Call{Call: _e.mock.On("UpdateDataAny", remoteWrite, persist, data, filterPartial, filterDelete)} } -func (_c *FunctionDataInterface_UpdateDataAny_Call) Run(run func(remoteWrite bool, persist bool, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FunctionDataInterface_UpdateDataAny_Call { +func (_c *FunctionDataInterface_UpdateDataAny_Call) Run(run func(remoteWrite bool, persist bool, data any, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FunctionDataInterface_UpdateDataAny_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(bool), args[1].(bool), args[2].(interface{}), args[3].(*model.FilterType), args[4].(*model.FilterType)) + run(args[0].(bool), args[1].(bool), args[2].(any), args[3].(*model.FilterType), args[4].(*model.FilterType)) }) return _c } -func (_c *FunctionDataInterface_UpdateDataAny_Call) Return(_a0 interface{}, _a1 *model.ErrorType) *FunctionDataInterface_UpdateDataAny_Call { +func (_c *FunctionDataInterface_UpdateDataAny_Call) Return(_a0 any, _a1 *model.ErrorType) *FunctionDataInterface_UpdateDataAny_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *FunctionDataInterface_UpdateDataAny_Call) RunAndReturn(run func(bool, bool, interface{}, *model.FilterType, *model.FilterType) (interface{}, *model.ErrorType)) *FunctionDataInterface_UpdateDataAny_Call { +func (_c *FunctionDataInterface_UpdateDataAny_Call) RunAndReturn(run func(bool, bool, any, *model.FilterType, *model.FilterType) (any, *model.ErrorType)) *FunctionDataInterface_UpdateDataAny_Call { _c.Call.Return(run) return _c } diff --git a/mocks/NodeManagementInterface.go b/mocks/NodeManagementInterface.go index 1705630..c2b6115 100644 --- a/mocks/NodeManagementInterface.go +++ b/mocks/NodeManagementInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.45.0. DO NOT EDIT. +// Code generated by mockery v2.46.3. DO NOT EDIT. package mocks @@ -426,19 +426,19 @@ func (_c *NodeManagementInterface_CleanWriteApprovalCaches_Call) RunAndReturn(ru } // DataCopy provides a mock function with given fields: function -func (_m *NodeManagementInterface) DataCopy(function model.FunctionType) interface{} { +func (_m *NodeManagementInterface) DataCopy(function model.FunctionType) any { ret := _m.Called(function) if len(ret) == 0 { panic("no return value specified for DataCopy") } - var r0 interface{} - if rf, ok := ret.Get(0).(func(model.FunctionType) interface{}); ok { + var r0 any + if rf, ok := ret.Get(0).(func(model.FunctionType) any); ok { r0 = rf(function) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) + r0 = ret.Get(0).(any) } } @@ -463,12 +463,12 @@ func (_c *NodeManagementInterface_DataCopy_Call) Run(run func(function model.Fun return _c } -func (_c *NodeManagementInterface_DataCopy_Call) Return(_a0 interface{}) *NodeManagementInterface_DataCopy_Call { +func (_c *NodeManagementInterface_DataCopy_Call) Return(_a0 any) *NodeManagementInterface_DataCopy_Call { _c.Call.Return(_a0) return _c } -func (_c *NodeManagementInterface_DataCopy_Call) RunAndReturn(run func(model.FunctionType) interface{}) *NodeManagementInterface_DataCopy_Call { +func (_c *NodeManagementInterface_DataCopy_Call) RunAndReturn(run func(model.FunctionType) any) *NodeManagementInterface_DataCopy_Call { _c.Call.Return(run) return _c } @@ -1080,7 +1080,7 @@ func (_c *NodeManagementInterface_RemoveRemoteSubscription_Call) RunAndReturn(ru } // RequestRemoteData provides a mock function with given fields: function, selector, elements, destination -func (_m *NodeManagementInterface) RequestRemoteData(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { +func (_m *NodeManagementInterface) RequestRemoteData(function model.FunctionType, selector any, elements any, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { ret := _m.Called(function, selector, elements, destination) if len(ret) == 0 { @@ -1089,10 +1089,10 @@ func (_m *NodeManagementInterface) RequestRemoteData(function model.FunctionType var r0 *model.MsgCounterType var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { + if rf, ok := ret.Get(0).(func(model.FunctionType, any, any, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { return rf(function, selector, elements, destination) } - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) *model.MsgCounterType); ok { + if rf, ok := ret.Get(0).(func(model.FunctionType, any, any, api.FeatureRemoteInterface) *model.MsgCounterType); ok { r0 = rf(function, selector, elements, destination) } else { if ret.Get(0) != nil { @@ -1100,7 +1100,7 @@ func (_m *NodeManagementInterface) RequestRemoteData(function model.FunctionType } } - if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) *model.ErrorType); ok { + if rf, ok := ret.Get(1).(func(model.FunctionType, any, any, api.FeatureRemoteInterface) *model.ErrorType); ok { r1 = rf(function, selector, elements, destination) } else { if ret.Get(1) != nil { @@ -1118,16 +1118,16 @@ type NodeManagementInterface_RequestRemoteData_Call struct { // RequestRemoteData is a helper method to define mock.On call // - function model.FunctionType -// - selector interface{} -// - elements interface{} +// - selector any +// - elements any // - destination api.FeatureRemoteInterface func (_e *NodeManagementInterface_Expecter) RequestRemoteData(function interface{}, selector interface{}, elements interface{}, destination interface{}) *NodeManagementInterface_RequestRemoteData_Call { return &NodeManagementInterface_RequestRemoteData_Call{Call: _e.mock.On("RequestRemoteData", function, selector, elements, destination)} } -func (_c *NodeManagementInterface_RequestRemoteData_Call) Run(run func(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemoteInterface)) *NodeManagementInterface_RequestRemoteData_Call { +func (_c *NodeManagementInterface_RequestRemoteData_Call) Run(run func(function model.FunctionType, selector any, elements any, destination api.FeatureRemoteInterface)) *NodeManagementInterface_RequestRemoteData_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(api.FeatureRemoteInterface)) + run(args[0].(model.FunctionType), args[1].(any), args[2].(any), args[3].(api.FeatureRemoteInterface)) }) return _c } @@ -1137,7 +1137,7 @@ func (_c *NodeManagementInterface_RequestRemoteData_Call) Return(_a0 *model.MsgC return _c } -func (_c *NodeManagementInterface_RequestRemoteData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *NodeManagementInterface_RequestRemoteData_Call { +func (_c *NodeManagementInterface_RequestRemoteData_Call) RunAndReturn(run func(model.FunctionType, any, any, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *NodeManagementInterface_RequestRemoteData_Call { _c.Call.Return(run) return _c } @@ -1252,7 +1252,7 @@ func (_c *NodeManagementInterface_Role_Call) RunAndReturn(run func() model.RoleT } // SetData provides a mock function with given fields: function, data -func (_m *NodeManagementInterface) SetData(function model.FunctionType, data interface{}) { +func (_m *NodeManagementInterface) SetData(function model.FunctionType, data any) { _m.Called(function, data) } @@ -1263,14 +1263,14 @@ type NodeManagementInterface_SetData_Call struct { // SetData is a helper method to define mock.On call // - function model.FunctionType -// - data interface{} +// - data any func (_e *NodeManagementInterface_Expecter) SetData(function interface{}, data interface{}) *NodeManagementInterface_SetData_Call { return &NodeManagementInterface_SetData_Call{Call: _e.mock.On("SetData", function, data)} } -func (_c *NodeManagementInterface_SetData_Call) Run(run func(function model.FunctionType, data interface{})) *NodeManagementInterface_SetData_Call { +func (_c *NodeManagementInterface_SetData_Call) Run(run func(function model.FunctionType, data any)) *NodeManagementInterface_SetData_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{})) + run(args[0].(model.FunctionType), args[1].(any)) }) return _c } @@ -1280,7 +1280,7 @@ func (_c *NodeManagementInterface_SetData_Call) Return() *NodeManagementInterfac return _c } -func (_c *NodeManagementInterface_SetData_Call) RunAndReturn(run func(model.FunctionType, interface{})) *NodeManagementInterface_SetData_Call { +func (_c *NodeManagementInterface_SetData_Call) RunAndReturn(run func(model.FunctionType, any)) *NodeManagementInterface_SetData_Call { _c.Call.Return(run) return _c } @@ -1535,7 +1535,7 @@ func (_c *NodeManagementInterface_Type_Call) RunAndReturn(run func() model.Featu } // UpdateData provides a mock function with given fields: function, data, filterPartial, filterDelete -func (_m *NodeManagementInterface) UpdateData(function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) *model.ErrorType { +func (_m *NodeManagementInterface) UpdateData(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) *model.ErrorType { ret := _m.Called(function, data, filterPartial, filterDelete) if len(ret) == 0 { @@ -1543,7 +1543,7 @@ func (_m *NodeManagementInterface) UpdateData(function model.FunctionType, data } var r0 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, *model.FilterType, *model.FilterType) *model.ErrorType); ok { + if rf, ok := ret.Get(0).(func(model.FunctionType, any, *model.FilterType, *model.FilterType) *model.ErrorType); ok { r0 = rf(function, data, filterPartial, filterDelete) } else { if ret.Get(0) != nil { @@ -1561,16 +1561,16 @@ type NodeManagementInterface_UpdateData_Call struct { // UpdateData is a helper method to define mock.On call // - function model.FunctionType -// - data interface{} +// - data any // - filterPartial *model.FilterType // - filterDelete *model.FilterType func (_e *NodeManagementInterface_Expecter) UpdateData(function interface{}, data interface{}, filterPartial interface{}, filterDelete interface{}) *NodeManagementInterface_UpdateData_Call { return &NodeManagementInterface_UpdateData_Call{Call: _e.mock.On("UpdateData", function, data, filterPartial, filterDelete)} } -func (_c *NodeManagementInterface_UpdateData_Call) Run(run func(function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *NodeManagementInterface_UpdateData_Call { +func (_c *NodeManagementInterface_UpdateData_Call) Run(run func(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType)) *NodeManagementInterface_UpdateData_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(*model.FilterType), args[3].(*model.FilterType)) + run(args[0].(model.FunctionType), args[1].(any), args[2].(*model.FilterType), args[3].(*model.FilterType)) }) return _c } @@ -1580,7 +1580,7 @@ func (_c *NodeManagementInterface_UpdateData_Call) Return(_a0 *model.ErrorType) return _c } -func (_c *NodeManagementInterface_UpdateData_Call) RunAndReturn(run func(model.FunctionType, interface{}, *model.FilterType, *model.FilterType) *model.ErrorType) *NodeManagementInterface_UpdateData_Call { +func (_c *NodeManagementInterface_UpdateData_Call) RunAndReturn(run func(model.FunctionType, any, *model.FilterType, *model.FilterType) *model.ErrorType) *NodeManagementInterface_UpdateData_Call { _c.Call.Return(run) return _c } diff --git a/model/commondatatypes_additions.go b/model/commondatatypes_additions.go index 1c099c5..1bfd918 100644 --- a/model/commondatatypes_additions.go +++ b/model/commondatatypes_additions.go @@ -297,10 +297,9 @@ func NewScaledNumberType(value float64) *ScaledNumberType { m.Number = &numberValue var scaleValue ScaleType - if numberValue != 0 { - scaleValue = ScaleType(-numberOfDecimals) - } else { - scaleValue = ScaleType(0) + scaleValue = ScaleType(0) + if numberValue != 0 && -numberOfDecimals >= math.MinInt8 && -numberOfDecimals <= math.MaxInt8 { + scaleValue = ScaleType(int8(-numberOfDecimals)) } m.Scale = &scaleValue diff --git a/model/nodemanagement_additions.go b/model/nodemanagement_additions.go index a48aa84..0bcca6b 100644 --- a/model/nodemanagement_additions.go +++ b/model/nodemanagement_additions.go @@ -29,7 +29,7 @@ func (r *NodeManagementDestinationListDataType) UpdateList(remoteWrite, persist } // helper type for easier filtering a specific UseCase element -type UseCaseFilter struct { +type UseCaseFilterType struct { Actor UseCaseActorType UseCaseName UseCaseNameType } @@ -159,7 +159,7 @@ func (n *NodeManagementUseCaseDataType) SetAvailability( // a provided FeatureAddressType, UseCaseActorType and UseCaseNameType func (n *NodeManagementUseCaseDataType) RemoveUseCaseSupport( address FeatureAddressType, - filter UseCaseFilter, + filter UseCaseFilterType, ) { nmMux.Lock() defer nmMux.Unlock() diff --git a/model/nodemanagement_additions_test.go b/model/nodemanagement_additions_test.go index 3215c6b..59cd116 100644 --- a/model/nodemanagement_additions_test.go +++ b/model/nodemanagement_additions_test.go @@ -79,7 +79,7 @@ func (s *NodeManagementUseCaseDataTypeSuite) Test_AdditionsAndRemovals() { ucs.RemoveUseCaseSupport( address, - UseCaseFilter{ + UseCaseFilterType{ Actor: UseCaseActorTypeCEM, UseCaseName: UseCaseNameTypeEVChargingSummary, }, @@ -97,7 +97,7 @@ func (s *NodeManagementUseCaseDataTypeSuite) Test_AdditionsAndRemovals() { ucs.RemoveUseCaseSupport( address, - UseCaseFilter{ + UseCaseFilterType{ Actor: UseCaseActorTypeCEM, UseCaseName: UseCaseNameTypeControlOfBattery, }, @@ -107,14 +107,14 @@ func (s *NodeManagementUseCaseDataTypeSuite) Test_AdditionsAndRemovals() { ucs.RemoveUseCaseSupport( address, - UseCaseFilter{ + UseCaseFilterType{ Actor: UseCaseActorTypeCEM, UseCaseName: UseCaseNameTypeEVSECommissioningAndConfiguration, }, ) assert.Equal(s.T(), 1, len(ucs.UseCaseInformation)) - ucs.RemoveUseCaseSupport(address, UseCaseFilter{}) + ucs.RemoveUseCaseSupport(address, UseCaseFilterType{}) assert.Equal(s.T(), 1, len(ucs.UseCaseInformation)) invalidAddress := FeatureAddressType{ @@ -123,7 +123,7 @@ func (s *NodeManagementUseCaseDataTypeSuite) Test_AdditionsAndRemovals() { } ucs.RemoveUseCaseSupport( invalidAddress, - UseCaseFilter{ + UseCaseFilterType{ Actor: UseCaseActorTypeCEM, UseCaseName: UseCaseNameTypeEVSECommissioningAndConfiguration, }, diff --git a/spine/entity_local.go b/spine/entity_local.go index 6f5cd54..2df33e0 100644 --- a/spine/entity_local.go +++ b/spine/entity_local.go @@ -149,7 +149,7 @@ func (r *EntityLocal) AddUseCaseSupport( } // Check if a use case is already added -func (r *EntityLocal) HasUseCaseSupport(uc model.UseCaseFilter) bool { +func (r *EntityLocal) HasUseCaseSupport(uc model.UseCaseFilterType) bool { nodeMgmt := r.device.NodeManagement() data, err := LocalFeatureDataCopyOfType[*model.NodeManagementUseCaseDataType](nodeMgmt, model.FunctionTypeNodeManagementUseCaseData) @@ -168,7 +168,7 @@ func (r *EntityLocal) HasUseCaseSupport(uc model.UseCaseFilter) bool { // Set the availability of a usecase. This may only be used for usescases // that act as a client within the usecase! func (r *EntityLocal) SetUseCaseAvailability( - uc model.UseCaseFilter, + uc model.UseCaseFilterType, available bool) { nodeMgmt := r.device.NodeManagement() @@ -188,7 +188,7 @@ func (r *EntityLocal) SetUseCaseAvailability( } // Remove a usecase with a list of given actor and usecase name -func (r *EntityLocal) RemoveUseCaseSupports(filters []model.UseCaseFilter) { +func (r *EntityLocal) RemoveUseCaseSupports(filters []model.UseCaseFilterType) { if len(filters) == 0 { return } diff --git a/spine/entity_local_test.go b/spine/entity_local_test.go index a75bb5e..6526a3c 100644 --- a/spine/entity_local_test.go +++ b/spine/entity_local_test.go @@ -57,7 +57,7 @@ func (suite *EntityLocalTestSuite) Test_Entity() { entity.RemoveAllUseCaseSupports() hasUC := entity.HasUseCaseSupport( - model.UseCaseFilter{ + model.UseCaseFilterType{ Actor: model.UseCaseActorTypeCEM, UseCaseName: model.UseCaseNameTypeEVSECommissioningAndConfiguration, }, @@ -79,7 +79,7 @@ func (suite *EntityLocalTestSuite) Test_Entity() { _, err = LocalFeatureDataCopyOfType[*model.NodeManagementUseCaseDataType](device.NodeManagement(), model.FunctionTypeNodeManagementUseCaseData) assert.Nil(suite.T(), err) - cemEvseUCFilter := model.UseCaseFilter{ + cemEvseUCFilter := model.UseCaseFilterType{ Actor: model.UseCaseActorTypeCEM, UseCaseName: model.UseCaseNameTypeEVSECommissioningAndConfiguration, } @@ -103,11 +103,11 @@ func (suite *EntityLocalTestSuite) Test_Entity() { false, ) - entity.RemoveUseCaseSupports([]model.UseCaseFilter{}) + entity.RemoveUseCaseSupports([]model.UseCaseFilterType{}) hasUC = entity.HasUseCaseSupport(cemEvseUCFilter) assert.Equal(suite.T(), true, hasUC) - entity.RemoveUseCaseSupports([]model.UseCaseFilter{cemEvseUCFilter}) + entity.RemoveUseCaseSupports([]model.UseCaseFilterType{cemEvseUCFilter}) hasUC = entity.HasUseCaseSupport(cemEvseUCFilter) assert.Equal(suite.T(), false, hasUC)