Documentation ¶
Index ¶
- Constants
- func GenerateSHA(targetContent *file.Content) ([]byte, error)
- func GetFCertificateFromKongCert(kongCert kong.Certificate) file.FCertificate
- func IsContentEmpty(content *file.Content) bool
- func PluginString(plugin file.FPlugin) string
- func ToDeckContent(ctx context.Context, log logrus.FieldLogger, k8sState *kongstate.KongState, ...) *file.Content
- type GenerateDeckContentParams
- type PluginSchemaStore
Constants ¶
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 ¶
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
IsContentEmpty returns true if the content is considered empty. This ignores meta fields like FormatVersion and Info.
func PluginString ¶
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.