question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom entrypoints

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
davidszottencommented, Jan 14, 2018

for future reference, the mailinglist is probably a better place for questions like this. thanks

0reactions
mattbennettcommented, Aug 13, 2018
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found