chore(gui): align remaining AX usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

This commit is contained in:
Virgil 2026-04-02 20:42:42 +00:00
parent 98b73fc14c
commit d9491380f8
3 changed files with 9 additions and 36 deletions

View file

@ -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)

View file

@ -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 := &notification.Service{}
// Use: svc := &notification.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)

View file

@ -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.