Merged
Conversation
Member
There was a problem hiding this comment.
The implementation and solution are looking good 👍
Just a doubt regarding the meaning of "public" / "publicize". Technically the services are always public in the Publication object (albeit with native Go APIs). What about using ExposeAsResources or ExposeLinks instead?
Member
Author
|
@mickael-menu I've changed it to |
mickael-menu
approved these changes
Oct 14, 2025
Member
mickael-menu
left a comment
There was a problem hiding this comment.
Thank you for making the changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This issue's goal is to give implementers more control over the access of a service publicly (e.g. webserver) versus in Go code, and provide the necessary building blocks to fix readium/cli#62
Changelog
All services are now hidden by default. This mainly affects implementers creating webservers, but you also shouldn't need to manually remove services just to produce clean manifest output. To restore previous functionality, set the
streamer.Config'sAddServiceLinkstotrueAdded
Servicesto get the names of all services currently in the builderExposeLinksandHideLinksfunction to toggle the exposure of a service via the links that get added to the WebPub manifest, as well as access to the service via its well-known link path. By default, services are privatestreamer.Confighas a new property,AddServiceLinks. Setting this property is equivalent to calling the aforementionedExposeLinksfunction for every serviceChanged
ServiceFactorynow has a requiredpublicproperty. This lets a service expose itself via theGetandLinksfunction if set to true. This also means that by default, all services are now "private". That means they will not be added to manifests as links, or callable by said link's path. They are still directly accessible in Go code using e.g.Publication.FindService, and then directly calling their functions by casting them to the correct service type (see e.g.Publication.Positions)