integration

package
v6.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package integration implements the `integration` commands. The four kinds of integration have the same endpoints, so one implementation serves them all.

Index

Constants

View Source
const Mask = "********"

Mask is what `export` writes in place of a credential. Like the platform's own mask of a secret, it is only asterisks, which is how apply and diff tell one.

Variables

View Source
var (
	Webhook = Kind{
		Name: "webhook", Title: "Webhook integration", Plural: "webhook integrations", Column: "url", ColumnTitle: "URL",

		Secrets: []string{"secret", "headers"},
		// contains filtered or unexported fields
	}
	Slack = Kind{
		Name: "slack", Title: "Slack integration", Plural: "Slack integrations", Column: "channel", ColumnTitle: "Channel",

		Secrets: []string{"url"},
		// contains filtered or unexported fields
	}
	Preflight = Kind{
		Name: "preflight", Title: "Preflight webhook", Plural: "preflight webhooks", Column: "url", ColumnTitle: "URL",
		Secrets: []string{"secret", "headers"},
		// contains filtered or unexported fields
	}
	PreflightAction = Kind{
		Name: "preflight-action", Title: "Preflight action integration", Plural: "preflight action integrations", Column: "preflightActionId", ColumnTitle: "Preflight action",
		// contains filtered or unexported fields
	}
	Kinds = []Kind{Webhook, Slack, Preflight, PreflightAction}
)
View Source
var ReadOnly = []string{"version"}

The version is dropped as `service get` drops it: kept in a file, it turns every apply after an edit in the UI into a conflict.

Functions

func Apply

func Apply(ctx context.Context, c *platform.Client, k Kind, o ApplyOptions) error

func Delete

func Delete(ctx context.Context, c *platform.Client, k Kind, o DeleteOptions) error

func Get

func Get(ctx context.Context, c *platform.Client, k Kind, o GetOptions) error

func List

func List(ctx context.Context, c *platform.Client, k Kind, explicitType string) error

func Masked added in v6.1.0

func Masked(v any) bool

Types

type ApplyOptions

type ApplyOptions struct {
	Files     []string
	Recursive bool
}

type DeleteOptions

type DeleteOptions struct {
	ID  string
	Yes bool
}

type GetOptions

type GetOptions struct {
	ID, File, Type string
}

type Kind

type Kind struct {
	Name   string // as the command names it
	Title  string // as messages name it
	Plural string
	// The column that says where the integration reports to.
	Column, ColumnTitle string
	// Secrets are the fields holding credentials; each value of a map among them is one.
	// `export` masks them, so that a tenant kept in Git does not hold them.
	Secrets []string
	// contains filtered or unexported fields
}

func (Kind) Fetch added in v6.1.0

Fetch gets one integration as `get` reads it.

func (Kind) FetchAll added in v6.1.0

func (k Kind) FetchAll(ctx context.Context, c *platform.Client) (*http.Response, error)

FetchAll lists the integrations of the kind, as `list` reads them.

func (Kind) MaskSecrets added in v6.1.0

func (k Kind) MaskSecrets(doc *jsyaml.Map)

MaskSecrets replaces the credentials in an integration with the mask.

Jump to

Keyboard shortcuts

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