Skip to content

Commit

Permalink
feat: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hokamsingh committed Sep 1, 2024
1 parent 2a935b6 commit b6eb457
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The `Controller` interface defines the contract for all controllers in the appli

```go
type Controller interface {
RegisterRoutes(r *router.Router)
RegisterRoutes(r *LessGo.Router)
}
```

Expand All @@ -31,7 +31,7 @@ type BaseController struct {
#### `BaseController.RegisterRoutes`

```go
func (bc *BaseController) RegisterRoutes(r *router.Router)
func (bc *BaseController) RegisterRoutes(r *LessGo.Router)
```

The `RegisterRoutes` method provides a default implementation of the `Controller` interface's method. It can be overridden by embedding `BaseController` in another struct and defining a custom implementation.
Expand All @@ -52,9 +52,9 @@ func NewTestController(service *TestService, path string) *TestController {
}
}

func (tc *TestController) RegisterRoutes(r *router.Router) {
func (tc *TestController) RegisterRoutes(r *LessGo.Router) {
tr := r.SubRouter(tc.Path)
tr.Get("/ping", func(ctx *router.Context) {
tr.Get("/ping", func(ctx *LessGo.Context) {
ctx.Send("pong")
})
}
Expand All @@ -63,7 +63,7 @@ func (tc *TestController) RegisterRoutes(r *router.Router) {
#### `RegisterModuleRoutes`

```go
func RegisterModuleRoutes(r *router.Router, m module.IModule)
func RegisterModuleRoutes(r *LessGo.Router, m LessGo.IModule)
```

The `RegisterModuleRoutes` function registers routes for a module. It iterates through the module's controllers, ensuring each controller implements the `Controller` interface and then calls `RegisterRoutes` to set up the routes.
Expand Down
2 changes: 1 addition & 1 deletion docs/scheduler.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Creates a new instance of `CronScheduler`. This scheduler can be used to schedul
**Example:**

```go
s := scheduler.NewCronScheduler()
s := LessGo.NewCronScheduler()
err := s.AddJob("* * * * *", func() {
fmt.Println("Hello, World!")
})
Expand Down

0 comments on commit b6eb457

Please sign in to comment.