owl-blogs/plugings/echo.go

24 lines
413 B
Go
Raw Permalink Normal View History

2023-08-09 19:56:56 +00:00
package plugings
import (
"fmt"
"owl-blogs/app"
"owl-blogs/domain/model"
)
type Echo struct {
}
2023-08-11 13:14:38 +00:00
func NewEcho(bus *app.EventBus) *Echo {
2023-08-09 19:56:56 +00:00
echo := &Echo{}
bus.Subscribe(echo)
return echo
}
2023-08-11 13:14:38 +00:00
func (e *Echo) NotifyEntryCreated(entry model.Entry) {
2023-08-09 19:56:56 +00:00
fmt.Println("Entry Created:")
fmt.Println("\tID: ", entry.ID())
fmt.Println("\tTitle: ", entry.Title())
fmt.Println("\tPublishedAt: ", entry.PublishedAt())
}