btp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package btp detects SAP BTP service bindings and resolves named BTP Destination Service entries (plus a Connectivity dialer for on-premise tunneling). Everything is optional: Detect returns nil outside Cloud Foundry/Kyma, and a nil *Bindings is safe to use — Resolve then reports ErrNoBinding.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoBinding = errors.New("no BTP Connectivity/Destination binding detected in this environment")

ErrNoBinding is returned by Resolve when no BTP Connectivity + Destination binding was detected in this environment.

Functions

This section is empty.

Types

type Bindings

type Bindings struct {
	Connectivity *binding.ConnectivityBinding
	Destination  *binding.DestinationBinding
}

Bindings holds resolved SAP BTP service bindings.

func Detect

func Detect() *Bindings

Detect resolves BTP Connectivity and Destination service bindings via btp-go's binding/auto (VCAP_SERVICES on Cloud Foundry, SERVICE_BINDING_ROOT or /bindings on Kyma). It returns nil (not an error) when no BTP environment is present — the expected, common case outside Cloud Foundry/Kyma.

func (*Bindings) Resolve

Resolve looks up name in the BTP Destination Service and returns the resolved destination plus a Connectivity dialer for tunneling on-premise traffic through Cloud Connector. Callers should route through the dialer only when dest.ProxyType == "OnPremise" (building the dialer itself performs no network I/O, so it's always cheap to return one). Shared by any source or target that needs to resolve a named BTP destination — source.SFTP and the db drivers all call this. A nil *Bindings is valid and returns ErrNoBinding, so b.Resolve can be passed around unconditionally.

Jump to

Keyboard shortcuts

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