escape

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package escape provides the API client for the Escape Platform

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Debug is a flag to enable debug mode for the API client

Functions

func CreateLocation

func CreateLocation(ctx context.Context, name, sshPublicKey string) (string, error)

CreateLocation creates a location

func DeleteIntegration

func DeleteIntegration(ctx context.Context, id string) error

DeleteIntegration Deletes an integration

func DeleteLocation

func DeleteLocation(ctx context.Context, id string) error

DeleteLocation deletes a location

func DownloadScanExchangesZip

func DownloadScanExchangesZip(ctx context.Context, scanID string, outPath string) error

DownloadScanExchangesZip downloads the zip file of the scan exchanges and puts them in outPath

func GetApplication

func GetApplication(ctx context.Context, id string) (*v2.GetApplication200Response, error)

GetApplication gets an application by ID

func GetIntegration

func GetIntegration(ctx context.Context, id string) (*v2.GetIntegration200Response, error)

GetIntegration Get an integration by ID

func GetLocation

GetLocation gets a location by ID

func GetScan

GetScan returns a scan by its ID

func GetScanIssues

func GetScanIssues(ctx context.Context, scanID string) ([]v2.ListIssues200ResponseInner, error)

GetScanIssues returns issues found in a scan

func ListApplications

func ListApplications(ctx context.Context) ([]v2.ListApplications200ResponseInner, error)

ListApplications lists all applications

func ListIntegrations

func ListIntegrations(ctx context.Context) ([]v2.ListIntegrations200ResponseInner, error)

ListIntegrations Lists all integrations

func ListLocations

func ListLocations(ctx context.Context) ([]v2.ListLocations200ResponseInner, error)

ListLocations lists all locations

func ListScans

func ListScans(ctx context.Context, applicationID, next string) ([]v2.ListScans200ResponseDataInner, string, error)

ListScans lists all scans for an application

func ListSubdomains

func ListSubdomains(ctx context.Context, count *int, after *string) ([]v2.ListSubdomains200ResponseDataInner, string, error)

ListSubdomains lists subdomains with pagination

func ParseJSONOrYAML

func ParseJSONOrYAML[T parsable](body []byte, v T) (T, error)

ParseJSONOrYAML parses a JSON or YAML data into the requested struct It returns an error if the data is neither JSON nor YAML

Example:

d, err := ParseJSONOrYAML([]byte(`{"kind": "KUBERNETES", "parameters": {}}`), &v2.GetIntegration200ResponseData{})

func StartScan

func StartScan(
	ctx context.Context,
	applicationID string,
	commitHash string,
	commitLink string,
	commitBranch string,
	commitAuthor string,
	commitAuthorProfilePictureLink string,
	configurationOverride *v2.CreateApplicationRequestConfiguration,
) (*v2.ListScans200ResponseDataInner, error)

StartScan starts a scan for an application

func UpdateApplicationConfig

func UpdateApplicationConfig(ctx context.Context, id string, configPath string) error

UpdateApplicationConfig updates an application configuration

func UpdateApplicationSchema

func UpdateApplicationSchema(ctx context.Context, id string, schemaPathOrURL string) error

UpdateApplicationSchema updates an application schema

func UpdateLocation

func UpdateLocation(ctx context.Context, id string, name, sshPublicKey string) error

UpdateLocation updates a location

func UpsertIntegration

func UpsertIntegration(ctx context.Context, name string, locationID *string, integration *v2.GetIntegration200ResponseData) error

UpsertIntegration Upserts an integration

func UpsertIntegrationFromFile

func UpsertIntegrationFromFile(ctx context.Context, filePath string) error

UpsertIntegrationFromFile Upserts an integration from a file

func UpsertLocation

func UpsertLocation(ctx context.Context, name, sshPublicKey string) (string, error)

UpsertLocation Creates or updates a location

func WatchScan

func WatchScan(ctx context.Context, scanID string) (chan *v2.ListScans200ResponseDataInner, error)

WatchScan watches scans status and logs

Types

This section is empty.

Jump to

Keyboard shortcuts

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