From 53ac49c8ef9fcb639230fdfb12698b0331d04bfb Mon Sep 17 00:00:00 2001 From: Snider Date: Fri, 24 Oct 2025 16:09:30 +0100 Subject: [PATCH] Add service integration example to README.md --- README.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b39f0ec5..33b3eeda 100644 --- a/README.md +++ b/README.md @@ -84,10 +84,38 @@ func main() { } ``` -### Registering Services -Core aunties that your application is not able to access any of the services that are not explicitly registered. -That said, +### Integrating your own services +```go +package demo + +import "github.com/Snider/Core" + +// this instance is the singleton instance of the demo module. +var instance *Demo + +type Demo struct { + name string + core *core.Core +} + +func Register(c *core.Core) error { + instance = &Demo{ + core: c, + } + if err := c.RegisterModule("demo", instance); err != nil { + return err + } + c.RegisterAction(handleActionCall) + return nil +} + +func handleActionCall(c *core.Core, msg core.Message) error { + return nil +} + + +``` ## Core.Display