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

internal: add PropFindValue #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

internal: add PropFindValue #161

wants to merge 1 commit into from

Conversation

emersion
Copy link
Owner

NewPropFindResponse uses callbacks to lazily build the response. However, some props are static: they don't require any processing to generate. Add a small helper to reduce boilerplate a bit.

NewPropFindResponse uses callbacks to lazily build the response.
However, some props are static: they don't require any processing
to generate. Add a small helper to reduce boilerplate a bit.
@emersion emersion requested a review from bitfehler April 17, 2024 15:54
Copy link

@oliverpool oliverpool left a comment

Choose a reason for hiding this comment

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

This change looks like a net improvement!

It would be nice to merge it, to prevent conflicts for future merge requests (I was almost ready to also make a fix for thunderbid, like #170 but with tests :)

@@ -162,13 +162,17 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) error {

type PropFindFunc func(raw *RawXMLValue) (interface{}, error)

func PropFindValue(value interface{}) PropFindFunc {

Choose a reason for hiding this comment

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

Would PropFindStatic be a name easier to grasp?

Suggested change
func PropFindValue(value interface{}) PropFindFunc {
func PropFindStatic(value interface{}) PropFindFunc {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants