capability

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package capability contains optional, independently versioned SDK contracts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigurationMethod

func ConfigurationMethod() author.Method[Configuration, Configured]

func HealthMethod

func HealthMethod() author.Method[HealthRequest, Health]

func RegisterConfiguration

func RegisterConfiguration(r *author.Registry, manager Configurer, configSchema schema.Schema, scope func(context.Context, plugin.Request, string) (string, error)) error

RegisterConfiguration requires an authenticated scope mapping. The mapper derives the manager key from the request's admitted subject and instance ID; this prevents two tenants from accidentally sharing a configured resource. Configuration values must not contain credentials; hosts own secret delivery.

func RegisterHealth

func RegisterHealth(r *author.Registry, check func(context.Context) (Health, error)) error

Types

type Configuration

type Configuration struct {
	Instance string          `json:"instance"`
	Revision string          `json:"revision"`
	Values   json.RawMessage `json:"values"`
}

type Configured

type Configured struct {
	Instance string `json:"instance"`
	Revision string `json:"revision"`
}

type Configurer

type Configurer interface {
	Configure(ctx context.Context, key, revision string, config json.RawMessage) error
}

Configurer applies a configuration to the instance stored under key. Both *instance.Manager[T] and the C engine's *cgoengine.Instances[T] implement it, so these helpers work over either.

type Health

type Health struct {
	Status string `json:"status"`
	Ready  bool   `json:"ready"`
}

type HealthRequest

type HealthRequest struct{}

Jump to

Keyboard shortcuts

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