Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • stork stork
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 310
    • Issues 310
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 21
    • Merge requests 21
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • storkstork
  • Issues
  • #942
Closed
Open
Issue created Jan 18, 2023 by Slawek Figiel@slawekDeveloper

Refactor decoding of the Kea config

The package for decoding the Kea config should be refactored. It doesn't encapsulate the Kea configuration details enough and doesn't provide a complete toolkit to interpret the JSON data.

Many Kea configuration details leak to other parts of the applications. It causes the description of the Kea config structure to be duplicated across the Stork. For example, the primary function for decoding subnets is located in the dbmodel package, outside the keaconfig package. Additionally, the configreview package defines a few partial decoders.

We duplicate these data to decode only the necessary data in a given context to decrease the performance impact. But the current solution breaks the encapsulation of Kea details (which is a wrong development practice). It causes the same data may be deserialized multiple times (it decreases the performance instead of increasing it).

We need to refactor the solution and wrap the Kea JSON with a struct to lazy access the decoded data. The struct will be responsible for deserializing data, encapsulating any Kea detail, and caching already decoded data.


Technical suggestion: We can try to investigate the possibility of using the RawMessage from the encoding/json package for lazy decoding of a JSON described by struct tags.

Assignee
Assign to
Time tracking