Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow setting custom transformer function as option #49

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

KevFan
Copy link
Contributor

@KevFan KevFan commented Nov 29, 2024

Description

Closes: #40

Allows option to enhance/extend the default transformation applied by watchers when listing objects

@KevFan KevFan self-assigned this Nov 29, 2024
use ./examples
use (
./examples
.
Copy link
Contributor Author

@KevFan KevFan Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the main module was required for me to properly run the example kuadrant in debug mode as otherwise it was not able to find the main module packages for adding break points

Comment on lines +266 to +267
func Restructure[T any](obj any) (any, error) {
return TransformFunc[T]()(obj)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably redundant if we choose to just use TransformFunc everywhere.
Not sure do we want to keep this in general

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idiomatic symmetry of having Restructure and Destruct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to enhance object transformation function
2 participants