chore(gui): align remaining AX usage examples
This commit is contained in:
parent
98b73fc14c
commit
d9491380f8
3 changed files with 9 additions and 36 deletions
|
|
@ -8,27 +8,18 @@ import (
|
|||
)
|
||||
|
||||
// Options configures the clipboard service.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// core.WithService(clipboard.Register(platform))
|
||||
// Use: core.WithService(clipboard.Register(platform))
|
||||
type Options struct{}
|
||||
|
||||
// Service manages clipboard operations via Core queries and tasks.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// svc := &clipboard.Service{}
|
||||
// Use: svc := &clipboard.Service{}
|
||||
type Service struct {
|
||||
*core.ServiceRuntime[Options]
|
||||
platform Platform
|
||||
}
|
||||
|
||||
// Register creates a Core service factory for the clipboard backend.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// core.New(core.WithService(clipboard.Register(platform)))
|
||||
// Use: core.New(core.WithService(clipboard.Register(platform)))
|
||||
func Register(p Platform) func(*core.Core) (any, error) {
|
||||
return func(c *core.Core) (any, error) {
|
||||
return &Service{
|
||||
|
|
@ -39,10 +30,7 @@ func Register(p Platform) func(*core.Core) (any, error) {
|
|||
}
|
||||
|
||||
// OnStartup registers clipboard handlers with Core.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// _ = svc.OnStartup(context.Background())
|
||||
// Use: _ = svc.OnStartup(context.Background())
|
||||
func (s *Service) OnStartup(ctx context.Context) error {
|
||||
s.Core().RegisterQuery(s.handleQuery)
|
||||
s.Core().RegisterTask(s.handleTask)
|
||||
|
|
|
|||
|
|
@ -11,27 +11,18 @@ import (
|
|||
)
|
||||
|
||||
// Options configures the notification service.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// core.WithService(notification.Register(platform))
|
||||
// Use: core.WithService(notification.Register(platform))
|
||||
type Options struct{}
|
||||
|
||||
// Service manages notifications via Core tasks and queries.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// svc := ¬ification.Service{}
|
||||
// Use: svc := ¬ification.Service{}
|
||||
type Service struct {
|
||||
*core.ServiceRuntime[Options]
|
||||
platform Platform
|
||||
}
|
||||
|
||||
// Register creates a Core service factory for the notification backend.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// core.New(core.WithService(notification.Register(platform)))
|
||||
// Use: core.New(core.WithService(notification.Register(platform)))
|
||||
func Register(p Platform) func(*core.Core) (any, error) {
|
||||
return func(c *core.Core) (any, error) {
|
||||
return &Service{
|
||||
|
|
@ -42,10 +33,7 @@ func Register(p Platform) func(*core.Core) (any, error) {
|
|||
}
|
||||
|
||||
// OnStartup registers notification handlers with Core.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// _ = svc.OnStartup(context.Background())
|
||||
// Use: _ = svc.OnStartup(context.Background())
|
||||
func (s *Service) OnStartup(ctx context.Context) error {
|
||||
s.Core().RegisterQuery(s.handleQuery)
|
||||
s.Core().RegisterTask(s.handleTask)
|
||||
|
|
|
|||
|
|
@ -9,10 +9,7 @@ import (
|
|||
)
|
||||
|
||||
// Options configures the systray service.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// core.WithService(systray.Register(platform))
|
||||
// Use: core.WithService(systray.Register(platform))
|
||||
type Options struct{}
|
||||
|
||||
// Service manages system tray operations via Core tasks.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue