deckgen

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

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) ([]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]interface{}, error)
}

Jump to

Keyboard shortcuts

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