Documentation
¶
Index ¶
- func Apply(deckfile *yaml.Node, selectors yamlbasics.SelectorSet, namespace string, ...) error
- func ApplyNamespaceHost(deckfile *yaml.Node, selectors yamlbasics.SelectorSet, hosts []string, ...) error
- func CheckNamespace(ns string) error
- func GetLuaStripFunction(ns string) string
- func GetPreFunctionPlugin(namespace string) *yaml.Node
- func InjectNamespaceStripping(deckfile *yaml.Node, namespace string, routesNeedStripping yamlbasics.NodeSet, ...)
- func UpdateRoute(route *yaml.Node, namespace string) bool
- func UpdateSinglePathString(path string, namespace string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(deckfile *yaml.Node, selectors yamlbasics.SelectorSet, namespace string, allowEmptySelection bool) error
Apply updates route entities with the namespace. The selectors should select the routes to update. If the selectors are empty, then all routes will be updated.
func ApplyNamespaceHost ¶ added in v0.1.31
func ApplyNamespaceHost( deckfile *yaml.Node, selectors yamlbasics.SelectorSet, hosts []string, clear bool, allowEmptySelection bool, ) error
ApplyNamespaceHost applies the namespace to the hosts field of the selected routes by adding the listed hosts if they ar not in the list already.
func CheckNamespace ¶
CheckNamespace validates the prefix namespace. Returns updated namespace. Must start with "/", and must have at least 1 character after the "/".
func GetLuaStripFunction ¶
GetLuaStripFunction returns the Lua function that strips the namespace from the upstream_uri.
func GetPreFunctionPlugin ¶
func GetPreFunctionPlugin(namespace string) *yaml.Node
GetPreFunctionPlugin returns a plugin that strips the namespace from the upstream_uri.
func InjectNamespaceStripping ¶
func InjectNamespaceStripping(deckfile *yaml.Node, namespace string, routesNeedStripping yamlbasics.NodeSet, routesNoStripping yamlbasics.NodeSet, )
InjectNamespaceStripping injects a namespace stripper into the deckfile. The namespace stripper will remove the namespace from the path, if it matches. updated+unchanged must together be ALL routes in the file!
func UpdateRoute ¶
UpdateRoute returns true if the route needs stripping the namespace. namespace must start with a "/" and end with a "/" (a single "/" is NOT valid).
func UpdateSinglePathString ¶
UpdateSinglePathString updates a single path string with the namespace and returns it.
Types ¶
This section is empty.