Documentation
¶
Overview ¶
Package example implements the example capability for demonstration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Descriptor ¶
func Descriptor(backend, app string, svc Service) hub.Descriptor
Descriptor returns the hub capability descriptor for the example capability.
func RegisterService ¶
RegisterService registers the example capability with the hub and ability registry. It returns nil and logs a warning when svc is nil (provider not configured).
Types ¶
type ListQuery ¶
type ListQuery struct {
Page ability.PageRequest
}
ListQuery wraps pagination for listing items.
type Service ¶
type Service interface {
GetItem(ctx context.Context, id string) (*ability.Host, error)
ListItems(ctx context.Context, q *ListQuery) (*ability.ListResult[ability.Host], error)
CreateItem(ctx context.Context, title string, tags types.KV) (*ability.Host, error)
UpdateItem(ctx context.Context, id string, data map[string]any) (*ability.Host, error)
DeleteItem(ctx context.Context, id string) error
HealthCheck(ctx context.Context) (bool, error)
ListRawEvents(ctx context.Context, cursor string) ([]any, string, error)
}
Service defines the example capability contract. Provider adapters implement this interface to bridge providers and invokers.
Click to show internal directories.
Click to hide internal directories.