function

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package function defines the public contracts kas injects into the CD Functions library: the seams through which a built-in Function reaches a resource it cannot construct for itself. Keeping these here — rather than in any one function's package — lets kas wire them once and every Function (and the gitlab-functions module) depend on the contract instead of each other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sRoundTripperFactory

type K8sRoundTripperFactory func(agentID int64) (http.RoundTripper, error)

K8sRoundTripperFactory yields an http.RoundTripper that proxies Kubernetes API requests to the apiserver of the cluster behind agentID. kas owns the name and supplies the implementation: in production it routes over the kas↔agentk tunnel (AgentConnPool-backed); tests supply a direct transport. It is the single seam through which Functions like argo.sync reach a tenant cluster, so this repo keeps no dependency on gitlab-agent. agentID is an int64 because that is kas's native agent identifier; a Function that takes it as a Starlark string parses it at the point it calls the factory.

type TokenResolver

type TokenResolver func() (string, error)

TokenResolver returns the GitLab token a Function authenticates with, or an error if no usable token is available. The gitlab-functions module owns where the token comes from and hands each Function a resolver, which the Function calls at run time. Sourcing the token this way — rather than as a workflow input — keeps a real credential out of the Starlark program and the step inputs, and leaves room to resolve it differently later (a kas-injected implementation, like K8sRoundTripperFactory) without touching the Functions or any workflow.

Jump to

Keyboard shortcuts

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