deploy

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package deploy orchestrates upserts of Hookdeck resources (sources, transformations, destinations, connections) from a resolved manifest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	UpsertSource(ctx context.Context, req *UpsertSourceRequest) (*UpsertSourceResult, error)
	UpsertDestination(ctx context.Context, req *UpsertDestinationRequest) (*UpsertDestinationResult, error)
	UpsertConnection(ctx context.Context, req *UpsertConnectionRequest) (*UpsertConnectionResult, error)
	UpsertTransformation(ctx context.Context, req *UpsertTransformationRequest) (*UpsertTransformationResult, error)
}

Client is the interface the deploy orchestrator needs.

type ConnectionDestRef

type ConnectionDestRef struct {
	Name string `json:"name"`
}

ConnectionDestRef is a name-based destination reference for connection upsert.

type ConnectionSourceRef

type ConnectionSourceRef struct {
	Name string `json:"name"`
}

ConnectionSourceRef is a name-based source reference for connection upsert.

type Options

type Options struct {
	DryRun   bool
	CodeRoot string // base directory for resolving relative code_file paths
}

Options controls deploy behaviour.

type ResourceResult

type ResourceResult struct {
	Name   string `json:"name"`
	ID     string `json:"id,omitempty"`
	Action string `json:"action"` // "upserted", "would upsert", "skipped"
}

ResourceResult captures the outcome for a single resource.

type Result

type Result struct {
	Source         *ResourceResult `json:"source,omitempty"`
	Transformation *ResourceResult `json:"transformation,omitempty"`
	Destination    *ResourceResult `json:"destination,omitempty"`
	Connection     *ResourceResult `json:"connection,omitempty"`
}

Result is the aggregate outcome of a deploy run.

func Deploy

func Deploy(ctx context.Context, client Client, m *manifest.Manifest, opts Options) (*Result, error)

Deploy upserts resources declared in the manifest in dependency order:

  1. Source
  2. Transformation
  3. Destination
  4. Connection (references source, destination, and optionally transformation)

In dry-run mode no API calls are made and client may be nil.

type UpsertConnectionRequest

type UpsertConnectionRequest struct {
	Name          *string                  `json:"name,omitempty"`
	SourceID      *string                  `json:"source_id,omitempty"`
	DestinationID *string                  `json:"destination_id,omitempty"`
	Source        *ConnectionSourceRef     `json:"source,omitempty"`
	Destination   *ConnectionDestRef       `json:"destination,omitempty"`
	Rules         []map[string]interface{} `json:"rules,omitempty"`
}

UpsertConnectionRequest is the payload for upserting a connection. The Hookdeck API accepts both ID-based references (source_id, destination_id) and name-based references (source.name, destination.name).

type UpsertConnectionResult

type UpsertConnectionResult struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

UpsertConnectionResult is the API response after upserting a connection.

type UpsertDestinationRequest

type UpsertDestinationRequest struct {
	Name        string                 `json:"name"`
	Type        string                 `json:"type,omitempty"`
	Description *string                `json:"description,omitempty"`
	Config      map[string]interface{} `json:"config,omitempty"`
}

UpsertDestinationRequest is the payload for upserting a destination. The Hookdeck API expects url, auth_type, auth, rate_limit, rate_limit_period inside a "config" object, not as top-level fields.

type UpsertDestinationResult

type UpsertDestinationResult struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

UpsertDestinationResult is the API response after upserting a destination.

type UpsertSourceRequest

type UpsertSourceRequest struct {
	Name        string                 `json:"name"`
	Type        string                 `json:"type,omitempty"`
	Description *string                `json:"description,omitempty"`
	Config      map[string]interface{} `json:"config,omitempty"`
}

UpsertSourceRequest is the payload for upserting a source.

type UpsertSourceResult

type UpsertSourceResult struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

UpsertSourceResult is the API response after upserting a source.

type UpsertTransformationRequest

type UpsertTransformationRequest struct {
	Name string            `json:"name"`
	Code string            `json:"code"`
	Env  map[string]string `json:"env,omitempty"`
}

UpsertTransformationRequest is the payload for upserting a transformation.

type UpsertTransformationResult

type UpsertTransformationResult struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

UpsertTransformationResult is the API response after upserting a transformation.

Jump to

Keyboard shortcuts

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