Custom entrypoints
See original GitHub issueI’m trying to automate some documentation on my services, and I’m struggling to get things to work. I’m new to nameko, only used it for testing and I’m feeling a little lost to get something more advanced like this to work.
Problem is that I have no idea where/how to collect class and method information to get the data I need: the closest thing I got was to write a class Documentation(Rpc)
and rpc = Documentation.decorator
and use that decorator instead to access the service class with self.container.service_cls
, but it seems that it executes for every method, and I need to group the information up. Also I have no idea how I could access the Documentation instance inside the action later.
In resume, what I want to accomplish it:
- Write a normal service
- Do something really simple if needed to the service (like a dependency
docs = Documentation()
) - A new rpc method “documentation” will be added automatically (without writing additional code) and it should return the docstrings from the class and its methods
- Should be able to call n.rpc.myservice.documentation() and get the data I need
Example
How service is written
class Service:
"""a docstring"""
name = "myservice"
@rpc
def test(self):
"""another docstring"""
return True
How service will behave like
class Service:
"""a docstring"""
name = "myservice"
@rpc
def test(self):
"""another docstring"""
return True
@rpc
def documentation(self):
return {
"service": "a doc string",
"methods": {
"test": "another docstring",
}
}
Thoughts?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Creating Custom Entry Points - SugarCRM Support Site
As of 6.3.x, entry points can be created using the extension framework. The entry point extension directory, located at ./custom/Extension/application/Ext ...
Read more >Custom Entrypoints - AWS Deep Learning Containers
For some images, Deep Learning Containers uses a custom entrypoint script. If you want to use your own entrypoint, you can override the...
Read more >EntryPoints - Traefik Labs documentation
EntryPoints are the network entry points into Traefik. They define the port which will receive the packets, and whether to listen for TCP...
Read more >Entry Points - Dagger
What is an entry point? An entry point is the boundary where you can get Dagger-provided objects from code that cannot use Dagger...
Read more >Hilt: custom entry points - Rock and Null
Hilt: custom entry points ... Hilt is a great dependency injection framework for Android. It has all the strengths of Dagger, delivered in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
for future reference, the mailinglist is probably a better place for questions like this. thanks
This issue was moved to https://discourse.nameko.io/t/custom-entrypoints/300