example

package
v0.92.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

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

func RegisterService(backend, app string, svc Service) error

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.

Directories

Path Synopsis
Package example implements the example provider adapter for the example capability.
Package example implements the example provider adapter for the example capability.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL