deckgen

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 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

Index

Constants

View Source
const StubUpstreamName = "kong"

StubUpstreamName is a name of a stub upstream that is created when the configuration is empty.

Variables

This section is empty.

Functions

func GenerateSHA

func GenerateSHA(targetContent *file.Content, customEntities map[string][]custom.Object) ([]byte, error)

GenerateSHA generates a SHA256 checksum of targetContent, with the purpose of change detection.

func GetFCertificateFromKongCert

func GetFCertificateFromKongCert(kongCert kong.Certificate) file.FCertificate

GetFCertificateFromKongCert converts a kong.Certificate to a file.FCertificate.

func IsContentEmpty

func IsContentEmpty(content *file.Content) bool

IsContentEmpty returns true if the content is considered empty. This ignores meta fields like FormatVersion and Info.

func PluginString

func PluginString(plugin file.FPlugin) string

PluginString returns a string representation of a FPlugin suitable as a sorting key.

Deprecated. To be replaced by a predicate that compares two FPlugins.

func ToDeckContent

func ToDeckContent(
	ctx context.Context,
	logger logr.Logger,
	k8sState *kongstate.KongState,
	params GenerateDeckContentParams,
) *file.Content

ToDeckContent generates a decK configuration from `k8sState` and auxiliary parameters.

Types

type GenerateDeckContentParams

type GenerateDeckContentParams struct {
	SelectorTags     []string
	ExpressionRoutes bool
	PluginSchemas    PluginSchemaStore

	// AppendStubEntityWhenConfigEmpty indicates whether to append a stub entity to the configuration when
	// the configuration is empty. It is used to workaround behavior in Kong where sending an empty configuration
	// does not make its `GET /status/ready` endpoint return 200s.
	AppendStubEntityWhenConfigEmpty bool
}

GenerateDeckContentParams is the parameters used to generate deck contents.

type PluginSchemaStore

type PluginSchemaStore interface {
	Schema(ctx context.Context, pluginName string) (map[string]any, error)
}

Jump to

Keyboard shortcuts

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