Documentation
¶
Overview ¶
Package service implements the provider-neutral service@v1 step kind. Provider process/container identities and handles remain behind Host; the adapter exports only bounded opaque references and typed readiness outputs.
Index ¶
- Constants
- Variables
- type Host
- type Kind
- func (k *Kind) Execute(ctx context.Context, prepared stepkind.PreparedInvocation) (stepkind.StepResult, error)
- func (k *Kind) ObserveService(ctx context.Context, ref stepkind.ExternalOperationRef) (stepkind.ServiceObservation, error)
- func (k *Kind) RequestStop(ctx context.Context, ref stepkind.ExternalOperationRef, key string) error
- func (*Kind) Spec() stepkind.StepKindSpec
- func (*Kind) ValidateConfig(_ context.Context, config graph.Config) []diagnostic.Diagnostic
- type Options
- type StartRequest
Constants ¶
View Source
const ( KindName = "service" KindVersion = "v1" )
Variables ¶
View Source
var ( ErrInvalidOptions = errors.New("invalid service adapter options") ErrInvalidConfig = errors.New("invalid service configuration") )
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host interface {
Start(context.Context, StartRequest) (stepkind.ExternalOperationRef, error)
Observe(context.Context, stepkind.ExternalOperationRef) (stepkind.ServiceObservation, error)
RequestStop(context.Context, stepkind.ExternalOperationRef, string) error
}
Host is the provider binding. Start and RequestStop must be exactly idempotent for their keys; Observe must not retain caller-owned aliases.
type Kind ¶
type Kind struct {
// contains filtered or unexported fields
}
func (*Kind) Execute ¶
func (k *Kind) Execute(ctx context.Context, prepared stepkind.PreparedInvocation) (stepkind.StepResult, error)
func (*Kind) ObserveService ¶
func (k *Kind) ObserveService(ctx context.Context, ref stepkind.ExternalOperationRef) (stepkind.ServiceObservation, error)
func (*Kind) RequestStop ¶
func (*Kind) Spec ¶
func (*Kind) Spec() stepkind.StepKindSpec
func (*Kind) ValidateConfig ¶
func (*Kind) ValidateConfig(_ context.Context, config graph.Config) []diagnostic.Diagnostic
type StartRequest ¶
type StartRequest struct {
Identity stepkind.InvocationIdentity `json:"identity"`
Provider string `json:"provider"`
Config graph.Config `json:"config"`
IdempotencyKey string `json:"idempotency_key"`
}
StartRequest is the immutable, idempotent provider request. Config is an adapter-owned JSON object; hosts must defensively copy it and persist only its digest plus non-secret provider references.
Click to show internal directories.
Click to hide internal directories.