Skip to content

internal: add PropFindValue#161

Merged
emersion merged 1 commit into
masterfrom
propfind-value
Jan 13, 2025
Merged

internal: add PropFindValue#161
emersion merged 1 commit into
masterfrom
propfind-value

Conversation

@emersion

Copy link
Copy Markdown
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

@oliverpool oliverpool left a comment

Copy link
Copy Markdown

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 :)

Comment thread internal/server.go

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

func PropFindValue(value interface{}) PropFindFunc {

Copy link
Copy Markdown

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 {

@barkyq

barkyq commented Jan 13, 2025

Copy link
Copy Markdown

looks cleaner

@barkyq

barkyq commented Jan 13, 2025

Copy link
Copy Markdown

🎆

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.

3 participants