integrations

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package integrations orchestrates provider-neutral CI/CD integrations.

Index

Constants

View Source
const (
	JobKind = "integration.operation"
)

Variables

This section is empty.

Functions

func IsRetryable

func IsRetryable(err error) bool

Types

type AlwaysLeader

type AlwaysLeader struct{}

func (AlwaysLeader) IsLeader

func (AlwaysLeader) IsLeader() bool

type CreateInput

type CreateInput struct {
	TenantID            shared.ID
	Provider            string
	Name                string
	Endpoint            string
	Config              map[string]any
	AllowPrivateNetwork bool
	PollInterval        time.Duration
	Actor               string
}

type Job

type Job struct {
	OperationID shared.ID `json:"operation_id"`
}

type Leadership

type Leadership interface {
	IsLeader() bool
}

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

func NewScheduler

func NewScheduler(store ports.IntegrationStore, tenants ports.TenantLister, queue ports.JobQueue, service *Service, clock ports.Clock, leadership Leadership, config SchedulerConfig, log *slog.Logger) (*Scheduler, error)

func (*Scheduler) Run

func (scheduler *Scheduler) Run(ctx context.Context)

func (*Scheduler) Tick

func (scheduler *Scheduler) Tick(ctx context.Context) (int, error)

type SchedulerConfig

type SchedulerConfig struct {
	Interval      time.Duration
	DispatchLimit int
	MaxQueueDepth int
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) Archive

func (service *Service) Archive(ctx context.Context, tenantID, integrationID shared.ID, version int, actor string) error

func (*Service) CancelOperation

func (service *Service) CancelOperation(ctx context.Context, tenantID, operationID shared.ID, actor string) (integration.Operation, error)

func (*Service) Create

func (service *Service) Create(ctx context.Context, input CreateInput) (integration.Integration, error)

func (*Service) CreateBinding

func (service *Service) CreateBinding(ctx context.Context, tenantID, integrationID, projectID shared.ID, externalKey, externalName, actor string) (integration.Binding, error)

func (*Service) DeleteBinding

func (service *Service) DeleteBinding(ctx context.Context, tenantID, integrationID, bindingID shared.ID, actor string) error

func (*Service) DeleteCredential

func (service *Service) DeleteCredential(ctx context.Context, tenantID, integrationID shared.ID, expectedVersion, expectedConnectionRevision int, actor string) error

func (*Service) Get

func (service *Service) Get(ctx context.Context, tenantID, id shared.ID) (integration.Integration, error)

func (*Service) GetOperation

func (service *Service) GetOperation(ctx context.Context, tenantID, operationID shared.ID) (integration.Operation, error)

func (*Service) HandleJob

func (service *Service) HandleJob(ctx context.Context, jobID string, payload []byte) (err error)

func (*Service) List

func (service *Service) List(ctx context.Context, tenantID shared.ID, includeArchived bool) ([]integration.Integration, error)

func (*Service) ListBindings

func (service *Service) ListBindings(ctx context.Context, tenantID, integrationID shared.ID) ([]integration.Binding, error)

func (*Service) ListExternalRuns

func (service *Service) ListExternalRuns(ctx context.Context, tenantID, integrationID shared.ID, limit int) ([]integration.ExternalRun, error)

func (*Service) ListOperations

func (service *Service) ListOperations(ctx context.Context, tenantID, integrationID shared.ID, limit int) ([]integration.Operation, error)

func (*Service) OnDeadLetter

func (service *Service) OnDeadLetter(ctx context.Context, payload []byte) error

func (*Service) ProviderDescriptors

func (service *Service) ProviderDescriptors() []integration.ProviderDescriptor

func (*Service) SetCredential

func (service *Service) SetCredential(ctx context.Context, tenantID, integrationID shared.ID, secrets map[string]string, expectedVersion, expectedConnectionRevision int, actor string) error

func (*Service) SetEnabled

func (service *Service) SetEnabled(ctx context.Context, tenantID, integrationID shared.ID, enabled bool, version int, actor string) (integration.Integration, error)

func (*Service) SetObserver

func (service *Service) SetObserver(observer ports.IntegrationObserver)

func (*Service) SetPrivateNetworkAllowed

func (service *Service) SetPrivateNetworkAllowed(allowed bool)

func (*Service) SetRunLock

func (service *Service) SetRunLock(runLock ports.RunLocker)

func (*Service) StartOperation

func (service *Service) StartOperation(ctx context.Context, tenantID, integrationID shared.ID, operationType integration.OperationType, actor string) (integration.Operation, error)

func (*Service) Update

func (service *Service) Update(ctx context.Context, tenantID, id shared.ID, input UpdateInput) (integration.Integration, error)

type UpdateInput

type UpdateInput struct {
	Name                string
	Endpoint            string
	Config              map[string]any
	AllowPrivateNetwork bool
	PollInterval        time.Duration
	Version             int
	Actor               string
}

Jump to

Keyboard shortcuts

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