deckgen

package
v2.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 12 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 added in v2.11.0

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,
	log logrus.FieldLogger,
	k8sState *kongstate.KongState,
	params GenerateDeckContentParams,
) *file.Content

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

Types

type GenerateDeckContentParams added in v2.10.0

type GenerateDeckContentParams struct {
	FormatVersion    string
	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 added in v2.9.0

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