Go to file
Florian Beisel 565f920b10
integrates Dynamic ENUM Metadata within Rules
Summary:
This commit revolutionizes our approach to handling ENUM metadata for
rule input structures by embedding this metadata directly within each
rule's definition. By leveraging the `EnumProvider` interface and
utilizing reflection, we've created a system where rules self-describe
their ENUM fields, enhancing the API's flexibility and maintainability.

The `GetRuleStruct` API endpoint is now capable of dynamically generating
responses that include both the input structure and ENUM options, directly
derived from the rule definitions themselves.

Key Changes:
- **Introduced `EnumProvider` Interface**:
Allows rule structs to define their own ENUM options, centralizing this
information within the rule implementations.

- **Enhanced Rule Descriptors**:
Rule descriptors are streamlined to focus on factory methods and input
struct types, with ENUM metadata being provided by the rules themselves
through the `EnumProvider` interface.

- **Dynamic ENUM Metadata Retrieval**:
The `GetRuleStruct` function dynamically extracts ENUM metadata from
rules that implement the `EnumProvider`, ensuring the API response
includes relevant ENUM options for frontend UI generation.

- **API Response Enhancement**:
Adjusted the API to provide a response that includes the rule's input
structure, possible ENUM values, and the rule instance representation,
all derived dynamically to support extensible and maintainable rule
definitions.
2024-02-06 21:05:44 +01:00
api integrates Dynamic ENUM Metadata within Rules 2024-02-06 21:05:44 +01:00
auth 🔊 Add logging to server.log when token generation fails 2024-01-21 16:17:35 +01:00
config 🎨 Use os.readfile instead of ioutil 2024-01-21 14:58:27 +01:00
db 🎨 add helper functions and general cleanup 2024-01-24 11:04:43 +01:00
docs Add rules routes 2024-01-24 11:03:08 +01:00
examples 📄 add license 2024-01-21 14:59:42 +01:00
middleware 🐛 fixes a bug not using the JWT Key correctly 2024-01-21 16:06:36 +01:00
models 📄 add license 2024-01-21 14:59:42 +01:00
router 🎨 add helper functions and general cleanup 2024-01-24 11:04:43 +01:00
rules integrates Dynamic ENUM Metadata within Rules 2024-02-06 21:05:44 +01:00
.gitignore 🔧 Create a configuration file interface 2024-01-18 01:04:43 +01:00
Dockerfile Add a Dockerfile 2024-01-24 10:58:30 +01:00
LICENSE 📄 Add a License 2024-01-18 01:22:43 +01:00
config.example.json 🔧 Create a configuration file interface 2024-01-18 01:04:43 +01:00
go.mod 🎨 add helper functions and general cleanup 2024-01-24 11:04:43 +01:00
go.sum 🎨 add helper functions and general cleanup 2024-01-24 11:04:43 +01:00
main.go 🎨 Refactor basic server structure 2024-01-21 14:54:34 +01:00