integrationapi

package
v1.164.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package integrationapi is the admin REST surface for integrations (#2659): every operation with the script chosen for it and its items, the scripts the picker offers, choosing and clearing an operation's script, and a retry. Choosing, changing, clearing and retrying are audited.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(mux *http.ServeMux, wrap func(http.Handler) http.Handler, cfg Config)

Register mounts the routes, each behind wrap, the admin API's authentication.

Types

type BindInput

type BindInput struct {
	ScriptID string `json:"script_id"`
	// IntervalSeconds is the timer, 60 to 86400; 0 or omitted keeps the
	// current one, 900 for a new binding.
	IntervalSeconds int `json:"interval_seconds,omitempty"`
	// Approve approves the script's latest version for handlers, as you.
	Approve bool `json:"approve,omitempty"`
}

BindInput chooses an operation's script.

type CandidateList

type CandidateList struct {
	Scripts []integration.Candidate `json:"scripts"`
}

CandidateList is the picker's scripts.

type Config

type Config struct {
	// Service carries out the actions; nil mounts nothing.
	Service Service
	// Actor is the administrator making a request. Every request the routes
	// see passed the admin API's authentication.
	Actor func(*http.Request) integration.Actor
	// Audit records every change; nil records none.
	Audit middleware.AuditLogger
}

Config carries the service and the parent-owned helpers.

type Done

type Done struct {
	Operation string `json:"operation"`
	Done      bool   `json:"done"`
}

Done is the answer to a clear or a retry.

type IntegrationList

type IntegrationList struct {
	Integrations []integration.Overview `json:"integrations"`
}

IntegrationList is the list response.

type Service

type Service interface {
	Overview(ctx context.Context) ([]integration.Overview, error)
	Candidates(ctx context.Context, a integration.Actor, op, search string) ([]integration.Candidate, error)
	Bind(ctx context.Context, a integration.Actor, req integration.BindRequest) (*integration.Binding, error)
	Clear(ctx context.Context, a integration.Actor, op string) error
	Retry(ctx context.Context, op string) error
}

Service is what the routes act through. *integration.Service satisfies it.

Jump to

Keyboard shortcuts

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