diff --git a/.gitignore b/.gitignore index bd60a6668..b39713749 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ ts/create-kpt-functions/bin # rapid property-based testing failure reproductions **/testdata/rapid/ +# compiled binaries +go/get-started/get-started + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..3de147b71 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,126 @@ +# Contributing to krm-functions-sdk + +We would love to accept your contributions to this project. There are just a few +small guidelines you need to follow. + +## Developer Certificate of Origin (DCO) + +Contributors to this project should state that they agree with the terms published +at https://developercertificate.org/ for their contribution. To do this when +creating a commit with the Git CLI, a sign-off can be added with +[the -s option](https://git-scm.com/docs/git-commit#git-commit--s). The sign-off +is stored as part of the commit message itself. + +## Copyright notices + +All files should have the copyright notice. +``` +// Copyright 2026 The kpt Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +``` + +If the file has never been modified: use the creation year only. + +* Example: `Copyright 2026 The kpt Authors` + +If the file has been modified: use a year range from creation to last modification. + +* Example: `Copyright 2024-2026 The kpt Authors` + +## Building and Testing + +The SDK uses a Makefile-based workflow. From the repository root: + +```bash +# Run all checks (fix, vet, fmt, test, lint) +make go + +# Run only tests +cd go && make test + +# Run only linting +cd go && make lint + +# Tidy all go.mod files +make tidy +``` + +The CI script (`hack/ci-validate-go.sh`) runs `make go` and then checks that no +files have been modified. If the CI script fails with "files are not to date", run `make go` +locally and commit the changes. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult [GitHub Help] for more +information on using pull requests. + +Process for code reviews. Before requesting human review, a PR must: + +* All tests passing +* All linting passing +* Meeting project code quality requirements, including passing all configured + static analysis and not reducing automated test coverage +* The comments from the first run of automatically generated comments (AI + generated comments, bot generated comments, etc.) of the PR are addressed + (addressing further re-runs of AI are optional) +* If it is not possible to resolve an automatic comment, please add a sub-comment + indicating why the automated comment cannot be resolved or ask for help in + resolving the comment +* The PR description states whether AI was used to help create the PR; if so, it + lists the AI tools used and the areas where they were used + +## Declare any use of AI + +> In addition to the above, the use of AI in the creation of PRs is allowed, but +> you must declare any use of AI and you must be able to explain the PR code +> independently of any AI tools. + +Update the PR description to state whether you used AI to help you create this +PR; if so, list the AI tools you have used and in what areas. + +For example: +```text +I have used AI in the creation of this PR. + +I have used the following AI tools: +- GitHub Copilot to analyse the code +- Kiro to generate the implementation and tests +``` + +### Attribute AI in the Git commit messages + +Following the [guidance of the Linux kernel](https://docs.kernel.org/process/coding-assistants.html#attribution) +we recommend the attribution of AI tools in the commit messages using the following format: + +```text +Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2] +``` + +## Community Guidelines + +This project follows a [Code of Conduct]. + +## Community Discussion Groups + +1. Join our [Slack channel](https://kubernetes.slack.com/channels/kpt) +1. Join our [Discussions](https://github.com/kptdev/kpt/discussions) + +## Governance + +The governance of the kpt project is described in the +[governance repo](https://github.com/kptdev/governance). + +[GitHub Help]: https://help.github.com/articles/about-pull-requests/ +[Code of Conduct]: code-of-conduct.md diff --git a/README.md b/README.md index 15508b162..fcc91f610 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,111 @@ # KRM Functions SDK + [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkptdev%2Fkrm-functions-sdk.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkptdev%2Fkrm-functions-sdk?ref=badge_shield) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10658/badge)](https://www.bestpractices.dev/projects/10658) -An opinionated Go SDK for implementing KRM functions. +An opinionated Go SDK for implementing [KRM functions](https://kpt.dev/book/05-developing-functions/). -## Documentation +## Quick Start -[Documentation](https://kpt.dev/book/05-developing-functions/#developing-in-go) +A KRM function is a program that reads Kubernetes resources from STDIN, transforms or validates them, and writes the result to STDOUT. The SDK handles the I/O — you write the logic. -## Issues +```go +package main + +import ( + "context" + _ "embed" + "os" + + "github.com/kptdev/krm-functions-sdk/go/fn" +) + +//go:embed README.md +var readme []byte + +//go:embed metadata.yaml +var metadata []byte + +type SetLabels struct { + Labels map[string]string `json:"labels,omitempty"` +} + +func (r *SetLabels) Run(ctx *fn.Context, functionConfig *fn.KubeObject, items fn.KubeObjects, results *fn.Results) bool { + for _, obj := range items { + for k, v := range r.Labels { + obj.SetLabel(k, v) + } + } + return true +} + +func main() { + runner := fn.WithContext(context.Background(), &SetLabels{}) + if err := fn.AsMain(runner, fn.WithDocs(readme, metadata)); err != nil { + os.Exit(1) + } +} +``` + +A starter template is available at [`go/get-started/`](go/get-started/main.go). For the full walkthrough, see the [Tutorial](docs/tutorial.md). + +## How It Works -Please [Open Issues](https://github.com/kptdev/kpt/issues) for this repo at [kptdev/kpt](https://github.com/kptdev/kpt/). +`fn.AsMain` is the single entrypoint. It handles: -## Pull requests +- **STDIN/STDOUT** (default) — reads a ResourceList, processes it, writes the result +- **File mode** — pass file paths as positional args for local debugging +- **`--help`** — prints human-readable docs from embedded README markers +- **`--doc`** — outputs machine-readable JSON (consumed by `kpt fn doc` and catalog pipelines) -Open pull requests [here](https://github.com/kptdev/krm-functions-sdk/pulls). +Register embedded documentation with `fn.WithDocs`: -## Discussions +```go +fn.AsMain(runner, fn.WithDocs(readme, metadata)) +``` -Discussions are [here](https://github.com/kptdev/kpt/discussions). +The SDK provides two interfaces for implementing functions: + +| Interface | Use for | Can add/remove items? | Auto-parses config? | +|---|---|---|---| +| `fn.Runner` | Transformers, validators | No | Yes | +| `fn.ResourceListProcessor` | Generators, complex functions | Yes | No | + +See [Interfaces](docs/interfaces.md) for details and code examples. + +## Documentation + +- [API Reference](https://pkg.go.dev/github.com/kptdev/krm-functions-sdk/go/fn) — Go API docs +- [Tutorial](docs/tutorial.md) — end-to-end function development +- [Interfaces](docs/interfaces.md) — Runner vs ResourceListProcessor +- [Testing](docs/testing.md) — golden test patterns +- [Containerizing](docs/containerizing.md) — building and running function images + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on DCO sign-off, copyright headers, and code review process. + +## Issues + +Please [open issues](https://github.com/kptdev/kpt/issues) at [kptdev/kpt](https://github.com/kptdev/kpt/). ## License Code is under the [Apache License 2.0](LICENSE), documentation is [CC BY 4.0](LICENSE-documentation). - [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkptdev%2Fkrm-functions-sdk.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkptdev%2Fkrm-functions-sdk?ref=badge_large) ## Governance -The governance of the kpt project and KRM Functiona Catalog are described in the +The governance of the kpt project is described in the [governance repo](https://github.com/kptdev/governance). ## Code of Conduct -The kpt project and the KRM Functions Catalog are following the +The kpt project follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). -More information and links about the CNCF Code of Conduct are [here](code-of-conduct.md). +More information is [here](code-of-conduct.md). ## CNCF -The kpt project including the KRM Functions Catalog is a [CNCF Sandbox](https://www.cncf.io/sandbox-projects/) project. +The kpt project is a [CNCF Sandbox](https://www.cncf.io/sandbox-projects/) project. diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index 139597f9c..000000000 --- a/docs/.nojekyll +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/docs/api/.nojekyll b/docs/api/.nojekyll deleted file mode 100644 index e2ac6616a..000000000 --- a/docs/api/.nojekyll +++ /dev/null @@ -1 +0,0 @@ -TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/api/assets/highlight.css b/docs/api/assets/highlight.css deleted file mode 100644 index 23dd8667e..000000000 --- a/docs/api/assets/highlight.css +++ /dev/null @@ -1,71 +0,0 @@ -:root { - --light-hl-0: #0000FF; - --dark-hl-0: #569CD6; - --light-hl-1: #000000; - --dark-hl-1: #D4D4D4; - --light-hl-2: #0070C1; - --dark-hl-2: #4FC1FF; - --light-hl-3: #001080; - --dark-hl-3: #9CDCFE; - --light-hl-4: #795E26; - --dark-hl-4: #DCDCAA; - --light-hl-5: #A31515; - --dark-hl-5: #CE9178; - --light-hl-6: #AF00DB; - --dark-hl-6: #C586C0; - --light-code-background: #FFFFFF; - --dark-code-background: #1E1E1E; -} - -@media (prefers-color-scheme: light) { :root { - --hl-0: var(--light-hl-0); - --hl-1: var(--light-hl-1); - --hl-2: var(--light-hl-2); - --hl-3: var(--light-hl-3); - --hl-4: var(--light-hl-4); - --hl-5: var(--light-hl-5); - --hl-6: var(--light-hl-6); - --code-background: var(--light-code-background); -} } - -@media (prefers-color-scheme: dark) { :root { - --hl-0: var(--dark-hl-0); - --hl-1: var(--dark-hl-1); - --hl-2: var(--dark-hl-2); - --hl-3: var(--dark-hl-3); - --hl-4: var(--dark-hl-4); - --hl-5: var(--dark-hl-5); - --hl-6: var(--dark-hl-6); - --code-background: var(--dark-code-background); -} } - -body.light { - --hl-0: var(--light-hl-0); - --hl-1: var(--light-hl-1); - --hl-2: var(--light-hl-2); - --hl-3: var(--light-hl-3); - --hl-4: var(--light-hl-4); - --hl-5: var(--light-hl-5); - --hl-6: var(--light-hl-6); - --code-background: var(--light-code-background); -} - -body.dark { - --hl-0: var(--dark-hl-0); - --hl-1: var(--dark-hl-1); - --hl-2: var(--dark-hl-2); - --hl-3: var(--dark-hl-3); - --hl-4: var(--dark-hl-4); - --hl-5: var(--dark-hl-5); - --hl-6: var(--dark-hl-6); - --code-background: var(--dark-code-background); -} - -.hl-0 { color: var(--hl-0); } -.hl-1 { color: var(--hl-1); } -.hl-2 { color: var(--hl-2); } -.hl-3 { color: var(--hl-3); } -.hl-4 { color: var(--hl-4); } -.hl-5 { color: var(--hl-5); } -.hl-6 { color: var(--hl-6); } -pre, code { background: var(--code-background); } diff --git a/docs/api/assets/icons.css b/docs/api/assets/icons.css deleted file mode 100644 index 776a3562d..000000000 --- a/docs/api/assets/icons.css +++ /dev/null @@ -1,1043 +0,0 @@ -.tsd-kind-icon { - display: block; - position: relative; - padding-left: 20px; - text-indent: -20px; -} -.tsd-kind-icon:before { - content: ""; - display: inline-block; - vertical-align: middle; - width: 17px; - height: 17px; - margin: 0 3px 2px 0; - background-image: url(./icons.png); -} -@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) { - .tsd-kind-icon:before { - background-image: url(./icons@2x.png); - background-size: 238px 204px; - } -} - -.tsd-signature.tsd-kind-icon:before { - background-position: 0 -153px; -} - -.tsd-kind-object-literal > .tsd-kind-icon:before { - background-position: 0px -17px; -} -.tsd-kind-object-literal.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -17px; -} -.tsd-kind-object-literal.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -17px; -} - -.tsd-kind-class > .tsd-kind-icon:before { - background-position: 0px -34px; -} -.tsd-kind-class.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -34px; -} -.tsd-kind-class.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -34px; -} - -.tsd-kind-class.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: 0px -51px; -} -.tsd-kind-class.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -17px -51px; -} -.tsd-kind-class.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -51px; -} - -.tsd-kind-interface > .tsd-kind-icon:before { - background-position: 0px -68px; -} -.tsd-kind-interface.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -68px; -} -.tsd-kind-interface.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -68px; -} - -.tsd-kind-interface.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: 0px -85px; -} -.tsd-kind-interface.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -17px -85px; -} -.tsd-kind-interface.tsd-has-type-parameter.tsd-is-private - > .tsd-kind-icon:before { - background-position: -34px -85px; -} - -.tsd-kind-namespace > .tsd-kind-icon:before { - background-position: 0px -102px; -} -.tsd-kind-namespace.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -102px; -} -.tsd-kind-namespace.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -102px; -} - -.tsd-kind-module > .tsd-kind-icon:before { - background-position: 0px -102px; -} -.tsd-kind-module.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -102px; -} -.tsd-kind-module.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -102px; -} - -.tsd-kind-enum > .tsd-kind-icon:before { - background-position: 0px -119px; -} -.tsd-kind-enum.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -119px; -} -.tsd-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -119px; -} - -.tsd-kind-enum-member > .tsd-kind-icon:before { - background-position: 0px -136px; -} -.tsd-kind-enum-member.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -136px; -} -.tsd-kind-enum-member.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -136px; -} - -.tsd-kind-signature > .tsd-kind-icon:before { - background-position: 0px -153px; -} -.tsd-kind-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -153px; -} -.tsd-kind-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -153px; -} - -.tsd-kind-type-alias > .tsd-kind-icon:before { - background-position: 0px -170px; -} -.tsd-kind-type-alias.tsd-is-protected > .tsd-kind-icon:before { - background-position: -17px -170px; -} -.tsd-kind-type-alias.tsd-is-private > .tsd-kind-icon:before { - background-position: -34px -170px; -} - -.tsd-kind-type-alias.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: 0px -187px; -} -.tsd-kind-type-alias.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -17px -187px; -} -.tsd-kind-type-alias.tsd-has-type-parameter.tsd-is-private - > .tsd-kind-icon:before { - background-position: -34px -187px; -} - -.tsd-kind-variable > .tsd-kind-icon:before { - background-position: -136px -0px; -} -.tsd-kind-variable.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -0px; -} -.tsd-kind-variable.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -0px; -} -.tsd-kind-variable.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -0px; -} -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -0px; -} -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -0px; -} -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -0px; -} -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -0px; -} -.tsd-kind-variable.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -0px; -} -.tsd-kind-variable.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -0px; -} -.tsd-kind-variable.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -0px; -} -.tsd-kind-variable.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -0px; -} -.tsd-kind-variable.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -0px; -} - -.tsd-kind-property > .tsd-kind-icon:before { - background-position: -136px -0px; -} -.tsd-kind-property.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -0px; -} -.tsd-kind-property.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -0px; -} -.tsd-kind-property.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -0px; -} -.tsd-kind-property.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -0px; -} -.tsd-kind-property.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -0px; -} -.tsd-kind-property.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -0px; -} -.tsd-kind-property.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -0px; -} -.tsd-kind-property.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -0px; -} -.tsd-kind-property.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -0px; -} -.tsd-kind-property.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -0px; -} -.tsd-kind-property.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -0px; -} -.tsd-kind-property.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -0px; -} - -.tsd-kind-get-signature > .tsd-kind-icon:before { - background-position: -136px -17px; -} -.tsd-kind-get-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -17px; -} -.tsd-kind-get-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -17px; -} -.tsd-kind-get-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -17px; -} - -.tsd-kind-set-signature > .tsd-kind-icon:before { - background-position: -136px -34px; -} -.tsd-kind-set-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -34px; -} -.tsd-kind-set-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -34px; -} -.tsd-kind-set-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -34px; -} - -.tsd-kind-accessor > .tsd-kind-icon:before { - background-position: -136px -51px; -} -.tsd-kind-accessor.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -51px; -} -.tsd-kind-accessor.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -51px; -} -.tsd-kind-accessor.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -51px; -} - -.tsd-kind-function > .tsd-kind-icon:before { - background-position: -136px -68px; -} -.tsd-kind-function.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -68px; -} -.tsd-kind-function.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; -} -.tsd-kind-function.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -68px; -} -.tsd-kind-function.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -68px; -} -.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -68px; -} -.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -68px; -} -.tsd-kind-function.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -68px; -} -.tsd-kind-function.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -68px; -} -.tsd-kind-function.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -68px; -} -.tsd-kind-function.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; -} -.tsd-kind-function.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -68px; -} -.tsd-kind-function.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -68px; -} - -.tsd-kind-method > .tsd-kind-icon:before { - background-position: -136px -68px; -} -.tsd-kind-method.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -68px; -} -.tsd-kind-method.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; -} -.tsd-kind-method.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -68px; -} -.tsd-kind-method.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -68px; -} -.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -68px; -} -.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -68px; -} -.tsd-kind-method.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; -} -.tsd-kind-method.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -68px; -} -.tsd-kind-method.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { - background-position: -187px -68px; -} -.tsd-kind-method.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; -} -.tsd-kind-method.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -68px; -} -.tsd-kind-method.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -68px; -} - -.tsd-kind-call-signature > .tsd-kind-icon:before { - background-position: -136px -68px; -} -.tsd-kind-call-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -68px; -} -.tsd-kind-call-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -68px; -} -.tsd-kind-call-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -68px; -} - -.tsd-kind-function.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: -136px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -153px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class - > .tsd-kind-icon:before { - background-position: -51px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum - > .tsd-kind-icon:before { - background-position: -170px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -85px; -} -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -85px; -} - -.tsd-kind-method.tsd-has-type-parameter > .tsd-kind-icon:before { - background-position: -136px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -153px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class - > .tsd-kind-icon:before { - background-position: -51px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum - > .tsd-kind-icon:before { - background-position: -170px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -85px; -} -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -85px; -} - -.tsd-kind-constructor > .tsd-kind-icon:before { - background-position: -136px -102px; -} -.tsd-kind-constructor.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -102px; -} -.tsd-kind-constructor.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -102px; -} -.tsd-kind-constructor.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -102px; -} - -.tsd-kind-constructor-signature > .tsd-kind-icon:before { - background-position: -136px -102px; -} -.tsd-kind-constructor-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -102px; -} -.tsd-kind-constructor-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -102px; -} -.tsd-kind-constructor-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -102px; -} - -.tsd-kind-index-signature > .tsd-kind-icon:before { - background-position: -136px -119px; -} -.tsd-kind-index-signature.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -119px; -} -.tsd-kind-index-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -119px; -} -.tsd-kind-index-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -119px; -} - -.tsd-kind-event > .tsd-kind-icon:before { - background-position: -136px -136px; -} -.tsd-kind-event.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -136px; -} -.tsd-kind-event.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -136px; -} -.tsd-kind-event.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -136px; -} -.tsd-kind-event.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { - background-position: -68px -136px; -} -.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { - background-position: -85px -136px; -} -.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -136px; -} -.tsd-kind-event.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -136px; -} -.tsd-kind-event.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -136px; -} -.tsd-kind-event.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { - background-position: -187px -136px; -} -.tsd-kind-event.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -136px; -} -.tsd-kind-event.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -136px; -} -.tsd-kind-event.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -136px; -} - -.tsd-is-static > .tsd-kind-icon:before { - background-position: -136px -153px; -} -.tsd-is-static.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -153px; -} -.tsd-is-static.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -153px; -} -.tsd-is-static.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -153px; -} -.tsd-is-static.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { - background-position: -68px -153px; -} -.tsd-is-static.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { - background-position: -85px -153px; -} -.tsd-is-static.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -153px; -} -.tsd-is-static.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -153px; -} -.tsd-is-static.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -153px; -} -.tsd-is-static.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { - background-position: -187px -153px; -} -.tsd-is-static.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -153px; -} -.tsd-is-static.tsd-parent-kind-interface > .tsd-kind-icon:before { - background-position: -204px -153px; -} -.tsd-is-static.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -153px; -} - -.tsd-is-static.tsd-kind-function > .tsd-kind-icon:before { - background-position: -136px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -170px; -} -.tsd-is-static.tsd-kind-function.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -170px; -} - -.tsd-is-static.tsd-kind-method > .tsd-kind-icon:before { - background-position: -136px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -170px; -} -.tsd-is-static.tsd-kind-method.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -170px; -} - -.tsd-is-static.tsd-kind-call-signature > .tsd-kind-icon:before { - background-position: -136px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -153px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class - > .tsd-kind-icon:before { - background-position: -51px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum - > .tsd-kind-icon:before { - background-position: -170px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -170px; -} -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -170px; -} - -.tsd-is-static.tsd-kind-event > .tsd-kind-icon:before { - background-position: -136px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-is-protected > .tsd-kind-icon:before { - background-position: -153px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-is-private > .tsd-kind-icon:before { - background-position: -119px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class > .tsd-kind-icon:before { - background-position: -51px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -68px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -85px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -102px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum > .tsd-kind-icon:before { - background-position: -170px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum.tsd-is-protected - > .tsd-kind-icon:before { - background-position: -187px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum.tsd-is-private - > .tsd-kind-icon:before { - background-position: -119px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-interface - > .tsd-kind-icon:before { - background-position: -204px -187px; -} -.tsd-is-static.tsd-kind-event.tsd-parent-kind-interface.tsd-is-inherited - > .tsd-kind-icon:before { - background-position: -221px -187px; -} diff --git a/docs/api/assets/icons.png b/docs/api/assets/icons.png deleted file mode 100644 index 3836d5fe4..000000000 Binary files a/docs/api/assets/icons.png and /dev/null differ diff --git a/docs/api/assets/icons@2x.png b/docs/api/assets/icons@2x.png deleted file mode 100644 index 5a209e2f6..000000000 Binary files a/docs/api/assets/icons@2x.png and /dev/null differ diff --git a/docs/api/assets/main.js b/docs/api/assets/main.js deleted file mode 100644 index 1cc526e6e..000000000 --- a/docs/api/assets/main.js +++ /dev/null @@ -1,52 +0,0 @@ -(()=>{var Ce=Object.create;var J=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var Me=t=>J(t,"__esModule",{value:!0});var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Oe(e))!_e.call(t,n)&&n!=="default"&&J(t,n,{get:()=>e[n],enumerable:!(r=Pe(e,n))||r.enumerable});return t},Ae=t=>De(Me(J(t!=null?Ce(Re(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var de=Fe((ue,he)=>{(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var h=t.utils.clone(r)||{};h.position=[a,l],h.index=s.length,s.push(new t.Token(n.slice(a,o),h))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(oc?h+=2:a==c&&(r+=n[l+1]*i[h+1],l+=2,h+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new t.TokenSet;s.node.edges["*"]=c}if(s.str.length==0&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var h=s.str.charAt(0),f=s.str.charAt(1),v;f in s.node.edges?v=s.node.edges[f]:(v=new t.TokenSet,s.node.edges[f]=v),s.str.length==1&&(v.final=!0),i.push({node:v,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),c=0;c1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof ue=="object"?he.exports=r():e.lunr=r()}(this,function(){return t})})()});var le=[];function N(t,e){le.push({selector:e,constructor:t})}var X=class{constructor(){this.createComponents(document.body)}createComponents(e){le.forEach(r=>{e.querySelectorAll(r.selector).forEach(n=>{n.dataset.hasInstance||(new r.constructor({el:n}),n.dataset.hasInstance=String(!0))})})}};var Q=class{constructor(e){this.el=e.el}};var Z=class{constructor(){this.listeners={}}addEventListener(e,r){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(r)}removeEventListener(e,r){if(!(e in this.listeners))return;let n=this.listeners[e];for(let i=0,s=n.length;i{let r=Date.now();return(...n)=>{r+e-Date.now()<0&&(t(...n),r=Date.now())}};var ee=class extends Z{constructor(){super();this.scrollTop=0;this.lastY=0;this.width=0;this.height=0;this.showToolbar=!0;this.toolbar=document.querySelector(".tsd-page-toolbar"),this.secondaryNav=document.querySelector(".tsd-navigation.secondary"),window.addEventListener("scroll",K(()=>this.onScroll(),10)),window.addEventListener("resize",K(()=>this.onResize(),10)),this.onResize(),this.onScroll()}triggerResize(){let e=new CustomEvent("resize",{detail:{width:this.width,height:this.height}});this.dispatchEvent(e)}onResize(){this.width=window.innerWidth||0,this.height=window.innerHeight||0;let e=new CustomEvent("resize",{detail:{width:this.width,height:this.height}});this.dispatchEvent(e)}onScroll(){this.scrollTop=window.scrollY||0;let e=new CustomEvent("scroll",{detail:{scrollTop:this.scrollTop}});this.dispatchEvent(e),this.hideShowToolbar()}hideShowToolbar(){let e=this.showToolbar;this.showToolbar=this.lastY>=this.scrollTop||this.scrollTop<=0,e!==this.showToolbar&&(this.toolbar.classList.toggle("tsd-page-toolbar--hide"),this.secondaryNav.classList.toggle("tsd-navigation--toolbar-hide")),this.lastY=this.scrollTop}},I=ee;I.instance=new ee;var te=class extends Q{constructor(e){super(e);this.anchors=[];this.index=-1;I.instance.addEventListener("resize",()=>this.onResize()),I.instance.addEventListener("scroll",r=>this.onScroll(r)),this.createAnchors()}createAnchors(){let e=window.location.href;e.indexOf("#")!=-1&&(e=e.substr(0,e.indexOf("#"))),this.el.querySelectorAll("a").forEach(r=>{let n=r.href;if(n.indexOf("#")==-1||n.substr(0,e.length)!=e)return;let i=n.substr(n.indexOf("#")+1),s=document.querySelector("a.tsd-anchor[name="+i+"]"),o=r.parentNode;!s||!o||this.anchors.push({link:o,anchor:s,position:0})}),this.onResize()}onResize(){let e;for(let n=0,i=this.anchors.length;nn.position-i.position);let r=new CustomEvent("scroll",{detail:{scrollTop:I.instance.scrollTop}});this.onScroll(r)}onScroll(e){let r=e.detail.scrollTop+5,n=this.anchors,i=n.length-1,s=this.index;for(;s>-1&&n[s].position>r;)s-=1;for(;s-1&&this.anchors[this.index].link.classList.remove("focus"),this.index=s,this.index>-1&&this.anchors[this.index].link.classList.add("focus"))}};var ce=(t,e=100)=>{let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>t(n),e)}};var pe=Ae(de());function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let r=document.querySelector("#tsd-search input"),n=document.querySelector("#tsd-search .results");if(!r||!n)throw new Error("The input field or the result list wrapper was not found");let i=!1;n.addEventListener("mousedown",()=>i=!0),n.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Ve(t,n,r,s)}function Ve(t,e,r,n){r.addEventListener("input",ce(()=>{ze(t,e,r,n)},200));let i=!1;r.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ne(e,r):s.key=="Escape"?r.blur():s.key=="ArrowUp"?me(e,-1):s.key==="ArrowDown"?me(e,1):i=!1}),r.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!r.matches(":focus")&&s.key==="/"&&(r.focus(),s.preventDefault())})}function He(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=pe.Index.load(window.searchData.index))}function ze(t,e,r,n){if(He(n,t),!n.index||!n.data)return;e.textContent="";let i=r.value.trim(),s=n.index.search(`*${i}*`);for(let o=0,a=Math.min(10,s.length);o${ve(c.parent,i)}.${l}`);let h=document.createElement("li");h.classList.value=c.classes;let f=document.createElement("a");f.href=n.base+c.url,f.classList.add("tsd-kind-icon"),f.innerHTML=l,h.append(f),e.appendChild(h)}}function me(t,e){let r=t.querySelector(".current");if(!r)r=t.querySelector(e==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let n=r;if(e===1)do n=n.nextElementSibling;while(n instanceof HTMLElement&&n.offsetParent==null);else do n=n.previousElementSibling;while(n instanceof HTMLElement&&n.offsetParent==null);n&&(r.classList.remove("current"),n.classList.add("current"))}}function Ne(t,e){let r=t.querySelector(".current");if(r||(r=t.querySelector("li:first-child")),r){let n=r.querySelector("a");n&&(window.location.href=n.href),e.blur()}}function ve(t,e){if(e==="")return t;let r=t.toLocaleLowerCase(),n=e.toLocaleLowerCase(),i=[],s=0,o=r.indexOf(n);for(;o!=-1;)i.push(re(t.substring(s,o)),`${re(t.substring(o,o+n.length))}`),s=o+n.length,o=r.indexOf(n,s);return i.push(re(t.substring(s))),i.join("")}var je={"&":"&","<":"<",">":">","'":"'",'"':"""};function re(t){return t.replace(/[&<>"'"]/g,e=>je[e])}var ge=class{constructor(e,r){this.signature=e,this.description=r}addClass(e){return this.signature.classList.add(e),this.description.classList.add(e),this}removeClass(e){return this.signature.classList.remove(e),this.description.classList.remove(e),this}},ne=class extends Q{constructor(e){super(e);this.groups=[];this.index=-1;this.createGroups(),this.container&&(this.el.classList.add("active"),Array.from(this.el.children).forEach(r=>{r.addEventListener("touchstart",n=>this.onClick(n)),r.addEventListener("click",n=>this.onClick(n))}),this.container.classList.add("active"),this.setIndex(0))}setIndex(e){if(e<0&&(e=0),e>this.groups.length-1&&(e=this.groups.length-1),this.index==e)return;let r=this.groups[e];if(this.index>-1){let n=this.groups[this.index];n.removeClass("current").addClass("fade-out"),r.addClass("current"),r.addClass("fade-in"),I.instance.triggerResize(),setTimeout(()=>{n.removeClass("fade-out"),r.removeClass("fade-in")},300)}else r.addClass("current"),I.instance.triggerResize();this.index=e}createGroups(){let e=this.el.children;if(e.length<2)return;this.container=this.el.nextElementSibling;let r=this.container.children;this.groups=[];for(let n=0;n{r.signature===e.currentTarget&&this.setIndex(n)})}};var C="mousedown",ye="mousemove",_="mouseup",G={x:0,y:0},xe=!1,ie=!1,Be=!1,A=!1,Le=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(Le?"is-mobile":"not-mobile");Le&&"ontouchstart"in document.documentElement&&(Be=!0,C="touchstart",ye="touchmove",_="touchend");document.addEventListener(C,t=>{ie=!0,A=!1;let e=C=="touchstart"?t.targetTouches[0]:t;G.y=e.pageY||0,G.x=e.pageX||0});document.addEventListener(ye,t=>{if(!!ie&&!A){let e=C=="touchstart"?t.targetTouches[0]:t,r=G.x-(e.pageX||0),n=G.y-(e.pageY||0);A=Math.sqrt(r*r+n*n)>10}});document.addEventListener(_,()=>{ie=!1});document.addEventListener("click",t=>{xe&&(t.preventDefault(),t.stopImmediatePropagation(),xe=!1)});var se=class extends Q{constructor(e){super(e);this.className=this.el.dataset.toggle||"",this.el.addEventListener(_,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(C,r=>this.onDocumentPointerDown(r)),document.addEventListener(_,r=>this.onDocumentPointerUp(r))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(e){A||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-menu, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!A&&this.active&&e.target.closest(".col-menu")){let r=e.target.closest("a");if(r){let n=window.location.href;n.indexOf("#")!=-1&&(n=n.substr(0,n.indexOf("#"))),r.href.substr(0,n.length)==n&&setTimeout(()=>this.setActive(!1),250)}}}};var oe=class{constructor(e,r){this.key=e,this.value=r,this.defaultValue=r,this.initialize(),window.localStorage[this.key]&&this.setValue(this.fromLocalStorage(window.localStorage[this.key]))}initialize(){}setValue(e){if(this.value==e)return;let r=this.value;this.value=e,window.localStorage[this.key]=this.toLocalStorage(e),this.handleValueChange(r,e)}},ae=class extends oe{initialize(){let e=document.querySelector("#tsd-filter-"+this.key);!e||(this.checkbox=e,this.checkbox.addEventListener("change",()=>{this.setValue(this.checkbox.checked)}))}handleValueChange(e,r){!this.checkbox||(this.checkbox.checked=this.value,document.documentElement.classList.toggle("toggle-"+this.key,this.value!=this.defaultValue))}fromLocalStorage(e){return e=="true"}toLocalStorage(e){return e?"true":"false"}},Ee=class extends oe{initialize(){document.documentElement.classList.add("toggle-"+this.key+this.value);let e=document.querySelector("#tsd-filter-"+this.key);if(!e)return;this.select=e;let r=()=>{this.select.classList.add("active")},n=()=>{this.select.classList.remove("active")};this.select.addEventListener(C,r),this.select.addEventListener("mouseover",r),this.select.addEventListener("mouseleave",n),this.select.querySelectorAll("li").forEach(i=>{i.addEventListener(_,s=>{e.classList.remove("active"),this.setValue(s.target.dataset.value||"")})}),document.addEventListener(C,i=>{this.select.contains(i.target)||this.select.classList.remove("active")})}handleValueChange(e,r){this.select.querySelectorAll("li.selected").forEach(s=>{s.classList.remove("selected")});let n=this.select.querySelector('li[data-value="'+r+'"]'),i=this.select.querySelector(".tsd-select-label");n&&i&&(n.classList.add("selected"),i.textContent=n.textContent),document.documentElement.classList.remove("toggle-"+e),document.documentElement.classList.add("toggle-"+r)}fromLocalStorage(e){return e}toLocalStorage(e){return e}},Y=class extends Q{constructor(e){super(e);this.optionVisibility=new Ee("visibility","private"),this.optionInherited=new ae("inherited",!0),this.optionExternals=new ae("externals",!0)}static isSupported(){try{return typeof window.localStorage!="undefined"}catch(e){return!1}}};function be(t){let e=localStorage.getItem("tsd-theme")||"os";t.value=e,we(e),t.addEventListener("change",()=>{localStorage.setItem("tsd-theme",t.value),we(t.value)})}function we(t){switch(t){case"os":document.body.classList.remove("light","dark");break;case"light":document.body.classList.remove("dark"),document.body.classList.add("light");break;case"dark":document.body.classList.remove("light"),document.body.classList.add("dark");break}}fe();N(te,".menu-highlight");N(ne,".tsd-signatures");N(se,"a[data-toggle]");Y.isSupported()?N(Y,"#tsd-filter"):document.documentElement.classList.add("no-filter");var Te=document.getElementById("theme");Te&&be(Te);var qe=new X;Object.defineProperty(window,"app",{value:qe});})(); -/*! - * lunr.Builder - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.Index - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.Pipeline - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.Set - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.TokenSet - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.Vector - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.stemmer - * Copyright (C) 2020 Oliver Nightingale - * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt - */ -/*! - * lunr.stopWordFilter - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.tokenizer - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.trimmer - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.utils - * Copyright (C) 2020 Oliver Nightingale - */ -/** - * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 - * Copyright (C) 2020 Oliver Nightingale - * @license MIT - */ diff --git a/docs/api/assets/search.js b/docs/api/assets/search.js deleted file mode 100644 index 52a9f31b4..000000000 --- a/docs/api/assets/search.js +++ /dev/null @@ -1 +0,0 @@ -window.searchData = {"kinds":{"32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":128,"name":"FunctionConfigError","url":"classes/FunctionConfigError.html","classes":"tsd-kind-class"},{"id":1,"kind":512,"name":"constructor","url":"classes/FunctionConfigError.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite","parent":"FunctionConfigError"},{"id":2,"kind":64,"name":"addAnnotation","url":"index.html#addAnnotation","classes":"tsd-kind-function"},{"id":3,"kind":64,"name":"removeAnnotation","url":"index.html#removeAnnotation","classes":"tsd-kind-function"},{"id":4,"kind":64,"name":"getAnnotation","url":"index.html#getAnnotation","classes":"tsd-kind-function"},{"id":5,"kind":64,"name":"addLabel","url":"index.html#addLabel","classes":"tsd-kind-function"},{"id":6,"kind":64,"name":"removeLabel","url":"index.html#removeLabel","classes":"tsd-kind-function"},{"id":7,"kind":64,"name":"getLabel","url":"index.html#getLabel","classes":"tsd-kind-function"},{"id":8,"kind":32,"name":"ANNOTATION_PREFIX","url":"index.html#ANNOTATION_PREFIX","classes":"tsd-kind-variable"},{"id":9,"kind":32,"name":"SOURCE_PATH_ANNOTATION","url":"index.html#SOURCE_PATH_ANNOTATION","classes":"tsd-kind-variable"},{"id":10,"kind":32,"name":"SOURCE_INDEX_ANNOTATION","url":"index.html#SOURCE_INDEX_ANNOTATION","classes":"tsd-kind-variable"},{"id":11,"kind":32,"name":"ID_ANNOTATION","url":"index.html#ID_ANNOTATION","classes":"tsd-kind-variable"},{"id":12,"kind":32,"name":"LEGACY_ANNOTATION_PREFIX","url":"index.html#LEGACY_ANNOTATION_PREFIX","classes":"tsd-kind-variable"},{"id":13,"kind":32,"name":"LEGACY_SOURCE_PATH_ANNOTATION","url":"index.html#LEGACY_SOURCE_PATH_ANNOTATION","classes":"tsd-kind-variable"},{"id":14,"kind":32,"name":"LEGACY_SOURCE_INDEX_ANNOTATION","url":"index.html#LEGACY_SOURCE_INDEX_ANNOTATION","classes":"tsd-kind-variable"},{"id":15,"kind":32,"name":"LEGACY_ID_ANNOTATION","url":"index.html#LEGACY_ID_ANNOTATION","classes":"tsd-kind-variable"},{"id":16,"kind":64,"name":"generalResult","url":"index.html#generalResult","classes":"tsd-kind-function"},{"id":17,"kind":64,"name":"configFileResult","url":"index.html#configFileResult","classes":"tsd-kind-function"},{"id":18,"kind":64,"name":"kubernetesObjectResult","url":"index.html#kubernetesObjectResult","classes":"tsd-kind-function"},{"id":19,"kind":64,"name":"run","url":"index.html#run","classes":"tsd-kind-function"},{"id":20,"kind":64,"name":"runFnWithConfigs","url":"index.html#runFnWithConfigs","classes":"tsd-kind-function"},{"id":21,"kind":128,"name":"TestRunner","url":"classes/TestRunner.html","classes":"tsd-kind-class"},{"id":22,"kind":512,"name":"constructor","url":"classes/TestRunner.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"TestRunner"},{"id":23,"kind":2048,"name":"assert","url":"classes/TestRunner.html#assert","classes":"tsd-kind-method tsd-parent-kind-class","parent":"TestRunner"},{"id":24,"kind":2048,"name":"assertCallback","url":"classes/TestRunner.html#assertCallback","classes":"tsd-kind-method tsd-parent-kind-class","parent":"TestRunner"},{"id":25,"kind":64,"name":"isKubernetesObject","url":"index.html#isKubernetesObject","classes":"tsd-kind-function"},{"id":26,"kind":64,"name":"kubernetesKey","url":"index.html#kubernetesKey","classes":"tsd-kind-function"},{"id":27,"kind":256,"name":"KptFunc","url":"interfaces/KptFunc.html","classes":"tsd-kind-interface"},{"id":28,"kind":1024,"name":"usage","url":"interfaces/KptFunc.html#usage","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"KptFunc"},{"id":29,"kind":128,"name":"Configs","url":"classes/Configs.html","classes":"tsd-kind-class"},{"id":30,"kind":512,"name":"constructor","url":"classes/Configs.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Configs"},{"id":31,"kind":2048,"name":"getAll","url":"classes/Configs.html#getAll","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":32,"kind":2048,"name":"get","url":"classes/Configs.html#get","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter","parent":"Configs"},{"id":33,"kind":2048,"name":"insert","url":"classes/Configs.html#insert","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":34,"kind":2048,"name":"delete","url":"classes/Configs.html#delete","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":35,"kind":2048,"name":"deleteAll","url":"classes/Configs.html#deleteAll","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":36,"kind":2048,"name":"groupBy","url":"classes/Configs.html#groupBy","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":37,"kind":2048,"name":"getFunctionConfig","url":"classes/Configs.html#getFunctionConfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":38,"kind":2048,"name":"getFunctionConfigMap","url":"classes/Configs.html#getFunctionConfigMap","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":39,"kind":2048,"name":"getFunctionConfigValue","url":"classes/Configs.html#getFunctionConfigValue","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":40,"kind":2048,"name":"hasUnexpectedFunctionParameter","url":"classes/Configs.html#hasUnexpectedFunctionParameter","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":41,"kind":2048,"name":"getFunctionConfigValueOrThrow","url":"classes/Configs.html#getFunctionConfigValueOrThrow","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":42,"kind":2048,"name":"addResults","url":"classes/Configs.html#addResults","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":43,"kind":2048,"name":"getResults","url":"classes/Configs.html#getResults","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":44,"kind":2048,"name":"toResourceList","url":"classes/Configs.html#toResourceList","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":45,"kind":2048,"name":"deepCopy","url":"classes/Configs.html#deepCopy","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Configs"},{"id":46,"kind":1024,"name":"logToStdErr","url":"classes/Configs.html#logToStdErr","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Configs"},{"id":47,"kind":256,"name":"KubernetesObject","url":"interfaces/KubernetesObject.html","classes":"tsd-kind-interface"},{"id":48,"kind":1024,"name":"apiVersion","url":"interfaces/KubernetesObject.html#apiVersion","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"KubernetesObject"},{"id":49,"kind":1024,"name":"kind","url":"interfaces/KubernetesObject.html#kind","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"KubernetesObject"},{"id":50,"kind":1024,"name":"metadata","url":"interfaces/KubernetesObject.html#metadata","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"KubernetesObject"},{"id":51,"kind":128,"name":"ResourceList","url":"classes/ResourceList.html","classes":"tsd-kind-class"},{"id":52,"kind":512,"name":"constructor","url":"classes/ResourceList.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"ResourceList"},{"id":53,"kind":1024,"name":"apiVersion","url":"classes/ResourceList.html#apiVersion","classes":"tsd-kind-property tsd-parent-kind-class","parent":"ResourceList"},{"id":54,"kind":1024,"name":"kind","url":"classes/ResourceList.html#kind","classes":"tsd-kind-property tsd-parent-kind-class","parent":"ResourceList"},{"id":55,"kind":1024,"name":"metadata","url":"classes/ResourceList.html#metadata","classes":"tsd-kind-property tsd-parent-kind-class","parent":"ResourceList"},{"id":56,"kind":65536,"name":"__type","url":"classes/ResourceList.html#__type","classes":"tsd-kind-type-literal tsd-parent-kind-class","parent":"ResourceList"},{"id":57,"kind":1024,"name":"name","url":"classes/ResourceList.html#__type.name","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"ResourceList.__type"},{"id":58,"kind":1024,"name":"items","url":"classes/ResourceList.html#items","classes":"tsd-kind-property tsd-parent-kind-class","parent":"ResourceList"},{"id":59,"kind":1024,"name":"results","url":"classes/ResourceList.html#results","classes":"tsd-kind-property tsd-parent-kind-class","parent":"ResourceList"},{"id":60,"kind":256,"name":"Result","url":"interfaces/Result.html","classes":"tsd-kind-interface"},{"id":61,"kind":1024,"name":"severity","url":"interfaces/Result.html#severity","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Result"},{"id":62,"kind":1024,"name":"message","url":"interfaces/Result.html#message","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Result"},{"id":63,"kind":1024,"name":"tags","url":"interfaces/Result.html#tags","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Result"},{"id":64,"kind":65536,"name":"__type","url":"interfaces/Result.html#__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-interface","parent":"Result"},{"id":65,"kind":1024,"name":"resourceRef","url":"interfaces/Result.html#resourceRef","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Result"},{"id":66,"kind":65536,"name":"__type","url":"interfaces/Result.html#__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-interface","parent":"Result"},{"id":67,"kind":1024,"name":"apiVersion","url":"interfaces/Result.html#__type-1.apiVersion","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Result.__type"},{"id":68,"kind":1024,"name":"kind","url":"interfaces/Result.html#__type-1.kind","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Result.__type"},{"id":69,"kind":1024,"name":"namespace","url":"interfaces/Result.html#__type-1.namespace","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Result.__type"},{"id":70,"kind":1024,"name":"name","url":"interfaces/Result.html#__type-1.name","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Result.__type"},{"id":71,"kind":1024,"name":"file","url":"interfaces/Result.html#file","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Result"},{"id":72,"kind":65536,"name":"__type","url":"interfaces/Result.html#__type","classes":"tsd-kind-type-literal tsd-parent-kind-interface","parent":"Result"},{"id":73,"kind":1024,"name":"path","url":"interfaces/Result.html#__type.path","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Result.__type"},{"id":74,"kind":1024,"name":"index","url":"interfaces/Result.html#__type.index","classes":"tsd-kind-property tsd-parent-kind-type-literal","parent":"Result.__type"},{"id":75,"kind":1024,"name":"field","url":"interfaces/Result.html#field","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Result"},{"id":76,"kind":4194304,"name":"Severity","url":"index.html#Severity","classes":"tsd-kind-type-alias"},{"id":77,"kind":256,"name":"JsonArray","url":"interfaces/JsonArray.html","classes":"tsd-kind-interface"},{"id":78,"kind":256,"name":"JsonMap","url":"interfaces/JsonMap.html","classes":"tsd-kind-interface"},{"id":79,"kind":4194304,"name":"Json","url":"index.html#Json","classes":"tsd-kind-type-alias"},{"id":80,"kind":256,"name":"FieldInfo","url":"interfaces/FieldInfo.html","classes":"tsd-kind-interface"},{"id":81,"kind":1024,"name":"path","url":"interfaces/FieldInfo.html#path","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"FieldInfo"},{"id":82,"kind":1024,"name":"currentValue","url":"interfaces/FieldInfo.html#currentValue","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"FieldInfo"},{"id":83,"kind":1024,"name":"suggestedValue","url":"interfaces/FieldInfo.html#suggestedValue","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"FieldInfo"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,35.264]],["parent/0",[]],["name/1",[1,29.386]],["parent/1",[0,2.788]],["name/2",[2,40.372]],["parent/2",[]],["name/3",[3,40.372]],["parent/3",[]],["name/4",[4,40.372]],["parent/4",[]],["name/5",[5,40.372]],["parent/5",[]],["name/6",[6,40.372]],["parent/6",[]],["name/7",[7,40.372]],["parent/7",[]],["name/8",[8,40.372]],["parent/8",[]],["name/9",[9,40.372]],["parent/9",[]],["name/10",[10,40.372]],["parent/10",[]],["name/11",[11,40.372]],["parent/11",[]],["name/12",[12,40.372]],["parent/12",[]],["name/13",[13,40.372]],["parent/13",[]],["name/14",[14,40.372]],["parent/14",[]],["name/15",[15,40.372]],["parent/15",[]],["name/16",[16,40.372]],["parent/16",[]],["name/17",[17,40.372]],["parent/17",[]],["name/18",[18,40.372]],["parent/18",[]],["name/19",[19,40.372]],["parent/19",[]],["name/20",[20,40.372]],["parent/20",[]],["name/21",[21,29.386]],["parent/21",[]],["name/22",[1,29.386]],["parent/22",[21,2.324]],["name/23",[22,40.372]],["parent/23",[21,2.324]],["name/24",[23,40.372]],["parent/24",[21,2.324]],["name/25",[24,40.372]],["parent/25",[]],["name/26",[25,40.372]],["parent/26",[]],["name/27",[26,35.264]],["parent/27",[]],["name/28",[27,40.372]],["parent/28",[26,2.788]],["name/29",[28,15.249]],["parent/29",[]],["name/30",[1,29.386]],["parent/30",[28,1.206]],["name/31",[29,40.372]],["parent/31",[28,1.206]],["name/32",[30,40.372]],["parent/32",[28,1.206]],["name/33",[31,40.372]],["parent/33",[28,1.206]],["name/34",[32,40.372]],["parent/34",[28,1.206]],["name/35",[33,40.372]],["parent/35",[28,1.206]],["name/36",[34,40.372]],["parent/36",[28,1.206]],["name/37",[35,40.372]],["parent/37",[28,1.206]],["name/38",[36,40.372]],["parent/38",[28,1.206]],["name/39",[37,40.372]],["parent/39",[28,1.206]],["name/40",[38,40.372]],["parent/40",[28,1.206]],["name/41",[39,40.372]],["parent/41",[28,1.206]],["name/42",[40,40.372]],["parent/42",[28,1.206]],["name/43",[41,40.372]],["parent/43",[28,1.206]],["name/44",[42,40.372]],["parent/44",[28,1.206]],["name/45",[43,40.372]],["parent/45",[28,1.206]],["name/46",[44,40.372]],["parent/46",[28,1.206]],["name/47",[45,29.386]],["parent/47",[]],["name/48",[46,31.899]],["parent/48",[45,2.324]],["name/49",[47,31.899]],["parent/49",[45,2.324]],["name/50",[48,35.264]],["parent/50",[45,2.324]],["name/51",[49,23.026]],["parent/51",[]],["name/52",[1,29.386]],["parent/52",[49,1.821]],["name/53",[46,31.899]],["parent/53",[49,1.821]],["name/54",[47,31.899]],["parent/54",[49,1.821]],["name/55",[48,35.264]],["parent/55",[49,1.821]],["name/56",[50,29.386]],["parent/56",[49,1.821]],["name/57",[51,35.264]],["parent/57",[52,3.192]],["name/58",[53,40.372]],["parent/58",[49,1.821]],["name/59",[54,40.372]],["parent/59",[49,1.821]],["name/60",[55,20.913]],["parent/60",[]],["name/61",[56,35.264]],["parent/61",[55,1.654]],["name/62",[57,40.372]],["parent/62",[55,1.654]],["name/63",[58,40.372]],["parent/63",[55,1.654]],["name/64",[50,29.386]],["parent/64",[55,1.654]],["name/65",[59,40.372]],["parent/65",[55,1.654]],["name/66",[50,29.386]],["parent/66",[55,1.654]],["name/67",[46,31.899]],["parent/67",[60,2.033]],["name/68",[47,31.899]],["parent/68",[60,2.033]],["name/69",[61,40.372]],["parent/69",[60,2.033]],["name/70",[51,35.264]],["parent/70",[60,2.033]],["name/71",[62,40.372]],["parent/71",[55,1.654]],["name/72",[50,29.386]],["parent/72",[55,1.654]],["name/73",[63,35.264]],["parent/73",[60,2.033]],["name/74",[64,40.372]],["parent/74",[60,2.033]],["name/75",[65,40.372]],["parent/75",[55,1.654]],["name/76",[56,35.264]],["parent/76",[]],["name/77",[66,40.372]],["parent/77",[]],["name/78",[67,40.372]],["parent/78",[]],["name/79",[68,40.372]],["parent/79",[]],["name/80",[69,29.386]],["parent/80",[]],["name/81",[63,35.264]],["parent/81",[69,2.324]],["name/82",[70,40.372]],["parent/82",[69,2.324]],["name/83",[71,40.372]],["parent/83",[69,2.324]]],"invertedIndex":[["__type",{"_index":50,"name":{"56":{},"64":{},"66":{},"72":{}},"parent":{}}],["addannotation",{"_index":2,"name":{"2":{}},"parent":{}}],["addlabel",{"_index":5,"name":{"5":{}},"parent":{}}],["addresults",{"_index":40,"name":{"42":{}},"parent":{}}],["annotation_prefix",{"_index":8,"name":{"8":{}},"parent":{}}],["apiversion",{"_index":46,"name":{"48":{},"53":{},"67":{}},"parent":{}}],["assert",{"_index":22,"name":{"23":{}},"parent":{}}],["assertcallback",{"_index":23,"name":{"24":{}},"parent":{}}],["configfileresult",{"_index":17,"name":{"17":{}},"parent":{}}],["configs",{"_index":28,"name":{"29":{}},"parent":{"30":{},"31":{},"32":{},"33":{},"34":{},"35":{},"36":{},"37":{},"38":{},"39":{},"40":{},"41":{},"42":{},"43":{},"44":{},"45":{},"46":{}}}],["constructor",{"_index":1,"name":{"1":{},"22":{},"30":{},"52":{}},"parent":{}}],["currentvalue",{"_index":70,"name":{"82":{}},"parent":{}}],["deepcopy",{"_index":43,"name":{"45":{}},"parent":{}}],["delete",{"_index":32,"name":{"34":{}},"parent":{}}],["deleteall",{"_index":33,"name":{"35":{}},"parent":{}}],["field",{"_index":65,"name":{"75":{}},"parent":{}}],["fieldinfo",{"_index":69,"name":{"80":{}},"parent":{"81":{},"82":{},"83":{}}}],["file",{"_index":62,"name":{"71":{}},"parent":{}}],["functionconfigerror",{"_index":0,"name":{"0":{}},"parent":{"1":{}}}],["generalresult",{"_index":16,"name":{"16":{}},"parent":{}}],["get",{"_index":30,"name":{"32":{}},"parent":{}}],["getall",{"_index":29,"name":{"31":{}},"parent":{}}],["getannotation",{"_index":4,"name":{"4":{}},"parent":{}}],["getfunctionconfig",{"_index":35,"name":{"37":{}},"parent":{}}],["getfunctionconfigmap",{"_index":36,"name":{"38":{}},"parent":{}}],["getfunctionconfigvalue",{"_index":37,"name":{"39":{}},"parent":{}}],["getfunctionconfigvalueorthrow",{"_index":39,"name":{"41":{}},"parent":{}}],["getlabel",{"_index":7,"name":{"7":{}},"parent":{}}],["getresults",{"_index":41,"name":{"43":{}},"parent":{}}],["groupby",{"_index":34,"name":{"36":{}},"parent":{}}],["hasunexpectedfunctionparameter",{"_index":38,"name":{"40":{}},"parent":{}}],["id_annotation",{"_index":11,"name":{"11":{}},"parent":{}}],["index",{"_index":64,"name":{"74":{}},"parent":{}}],["insert",{"_index":31,"name":{"33":{}},"parent":{}}],["iskubernetesobject",{"_index":24,"name":{"25":{}},"parent":{}}],["items",{"_index":53,"name":{"58":{}},"parent":{}}],["json",{"_index":68,"name":{"79":{}},"parent":{}}],["jsonarray",{"_index":66,"name":{"77":{}},"parent":{}}],["jsonmap",{"_index":67,"name":{"78":{}},"parent":{}}],["kind",{"_index":47,"name":{"49":{},"54":{},"68":{}},"parent":{}}],["kptfunc",{"_index":26,"name":{"27":{}},"parent":{"28":{}}}],["kuberneteskey",{"_index":25,"name":{"26":{}},"parent":{}}],["kubernetesobject",{"_index":45,"name":{"47":{}},"parent":{"48":{},"49":{},"50":{}}}],["kubernetesobjectresult",{"_index":18,"name":{"18":{}},"parent":{}}],["legacy_annotation_prefix",{"_index":12,"name":{"12":{}},"parent":{}}],["legacy_id_annotation",{"_index":15,"name":{"15":{}},"parent":{}}],["legacy_source_index_annotation",{"_index":14,"name":{"14":{}},"parent":{}}],["legacy_source_path_annotation",{"_index":13,"name":{"13":{}},"parent":{}}],["logtostderr",{"_index":44,"name":{"46":{}},"parent":{}}],["message",{"_index":57,"name":{"62":{}},"parent":{}}],["metadata",{"_index":48,"name":{"50":{},"55":{}},"parent":{}}],["name",{"_index":51,"name":{"57":{},"70":{}},"parent":{}}],["namespace",{"_index":61,"name":{"69":{}},"parent":{}}],["path",{"_index":63,"name":{"73":{},"81":{}},"parent":{}}],["removeannotation",{"_index":3,"name":{"3":{}},"parent":{}}],["removelabel",{"_index":6,"name":{"6":{}},"parent":{}}],["resourcelist",{"_index":49,"name":{"51":{}},"parent":{"52":{},"53":{},"54":{},"55":{},"56":{},"58":{},"59":{}}}],["resourcelist.__type",{"_index":52,"name":{},"parent":{"57":{}}}],["resourceref",{"_index":59,"name":{"65":{}},"parent":{}}],["result",{"_index":55,"name":{"60":{}},"parent":{"61":{},"62":{},"63":{},"64":{},"65":{},"66":{},"71":{},"72":{},"75":{}}}],["result.__type",{"_index":60,"name":{},"parent":{"67":{},"68":{},"69":{},"70":{},"73":{},"74":{}}}],["results",{"_index":54,"name":{"59":{}},"parent":{}}],["run",{"_index":19,"name":{"19":{}},"parent":{}}],["runfnwithconfigs",{"_index":20,"name":{"20":{}},"parent":{}}],["severity",{"_index":56,"name":{"61":{},"76":{}},"parent":{}}],["source_index_annotation",{"_index":10,"name":{"10":{}},"parent":{}}],["source_path_annotation",{"_index":9,"name":{"9":{}},"parent":{}}],["suggestedvalue",{"_index":71,"name":{"83":{}},"parent":{}}],["tags",{"_index":58,"name":{"63":{}},"parent":{}}],["testrunner",{"_index":21,"name":{"21":{}},"parent":{"22":{},"23":{},"24":{}}}],["toresourcelist",{"_index":42,"name":{"44":{}},"parent":{}}],["usage",{"_index":27,"name":{"28":{}},"parent":{}}]],"pipeline":[]}} \ No newline at end of file diff --git a/docs/api/assets/style.css b/docs/api/assets/style.css deleted file mode 100644 index ff488199d..000000000 --- a/docs/api/assets/style.css +++ /dev/null @@ -1,1384 +0,0 @@ -@import url("./icons.css"); - -:root { - /* Light */ - --light-color-background: #fcfcfc; - --light-color-secondary-background: #fff; - --light-color-text: #222; - --light-color-text-aside: #707070; - --light-color-link: #4da6ff; - --light-color-menu-divider: #eee; - --light-color-menu-divider-focus: #000; - --light-color-menu-label: #707070; - --light-color-panel: var(--light-color-secondary-background); - --light-color-panel-divider: #eee; - --light-color-comment-tag: #707070; - --light-color-comment-tag-text: #fff; - --light-color-ts: #9600ff; - --light-color-ts-interface: #647f1b; - --light-color-ts-enum: #937210; - --light-color-ts-class: #0672de; - --light-color-ts-private: #707070; - --light-color-toolbar: #fff; - --light-color-toolbar-text: #333; - --light-icon-filter: invert(0); - --light-external-icon: url("data:image/svg+xml;utf8,"); - - /* Dark */ - --dark-color-background: #36393f; - --dark-color-secondary-background: #2f3136; - --dark-color-text: #ffffff; - --dark-color-text-aside: #e6e4e4; - --dark-color-link: #00aff4; - --dark-color-menu-divider: #eee; - --dark-color-menu-divider-focus: #000; - --dark-color-menu-label: #707070; - --dark-color-panel: var(--dark-color-secondary-background); - --dark-color-panel-divider: #818181; - --dark-color-comment-tag: #dcddde; - --dark-color-comment-tag-text: #2f3136; - --dark-color-ts: #c97dff; - --dark-color-ts-interface: #9cbe3c; - --dark-color-ts-enum: #d6ab29; - --dark-color-ts-class: #3695f3; - --dark-color-ts-private: #e2e2e2; - --dark-color-toolbar: #34373c; - --dark-color-toolbar-text: #ffffff; - --dark-icon-filter: invert(1); - --dark-external-icon: url("data:image/svg+xml;utf8,"); -} - -@media (prefers-color-scheme: light) { - :root { - --color-background: var(--light-color-background); - --color-secondary-background: var(--light-color-secondary-background); - --color-text: var(--light-color-text); - --color-text-aside: var(--light-color-text-aside); - --color-link: var(--light-color-link); - --color-menu-divider: var(--light-color-menu-divider); - --color-menu-divider-focus: var(--light-color-menu-divider-focus); - --color-menu-label: var(--light-color-menu-label); - --color-panel: var(--light-color-panel); - --color-panel-divider: var(--light-color-panel-divider); - --color-comment-tag: var(--light-color-comment-tag); - --color-comment-tag-text: var(--light-color-comment-tag-text); - --color-ts: var(--light-color-ts); - --color-ts-interface: var(--light-color-ts-interface); - --color-ts-enum: var(--light-color-ts-enum); - --color-ts-class: var(--light-color-ts-class); - --color-ts-private: var(--light-color-ts-private); - --color-toolbar: var(--light-color-toolbar); - --color-toolbar-text: var(--light-color-toolbar-text); - --icon-filter: var(--light-icon-filter); - --external-icon: var(--light-external-icon); - } -} - -@media (prefers-color-scheme: dark) { - :root { - --color-background: var(--dark-color-background); - --color-secondary-background: var(--dark-color-secondary-background); - --color-text: var(--dark-color-text); - --color-text-aside: var(--dark-color-text-aside); - --color-link: var(--dark-color-link); - --color-menu-divider: var(--dark-color-menu-divider); - --color-menu-divider-focus: var(--dark-color-menu-divider-focus); - --color-menu-label: var(--dark-color-menu-label); - --color-panel: var(--dark-color-panel); - --color-panel-divider: var(--dark-color-panel-divider); - --color-comment-tag: var(--dark-color-comment-tag); - --color-comment-tag-text: var(--dark-color-comment-tag-text); - --color-ts: var(--dark-color-ts); - --color-ts-interface: var(--dark-color-ts-interface); - --color-ts-enum: var(--dark-color-ts-enum); - --color-ts-class: var(--dark-color-ts-class); - --color-ts-private: var(--dark-color-ts-private); - --color-toolbar: var(--dark-color-toolbar); - --color-toolbar-text: var(--dark-color-toolbar-text); - --icon-filter: var(--dark-icon-filter); - --external-icon: var(--dark-external-icon); - } -} - -body { - margin: 0; -} - -body.light { - --color-background: var(--light-color-background); - --color-secondary-background: var(--light-color-secondary-background); - --color-text: var(--light-color-text); - --color-text-aside: var(--light-color-text-aside); - --color-link: var(--light-color-link); - --color-menu-divider: var(--light-color-menu-divider); - --color-menu-divider-focus: var(--light-color-menu-divider-focus); - --color-menu-label: var(--light-color-menu-label); - --color-panel: var(--light-color-panel); - --color-panel-divider: var(--light-color-panel-divider); - --color-comment-tag: var(--light-color-comment-tag); - --color-comment-tag-text: var(--light-color-comment-tag-text); - --color-ts: var(--light-color-ts); - --color-ts-interface: var(--light-color-ts-interface); - --color-ts-enum: var(--light-color-ts-enum); - --color-ts-class: var(--light-color-ts-class); - --color-ts-private: var(--light-color-ts-private); - --color-toolbar: var(--light-color-toolbar); - --color-toolbar-text: var(--light-color-toolbar-text); - --icon-filter: var(--light-icon-filter); - --external-icon: var(--light-external-icon); -} - -body.dark { - --color-background: var(--dark-color-background); - --color-secondary-background: var(--dark-color-secondary-background); - --color-text: var(--dark-color-text); - --color-text-aside: var(--dark-color-text-aside); - --color-link: var(--dark-color-link); - --color-menu-divider: var(--dark-color-menu-divider); - --color-menu-divider-focus: var(--dark-color-menu-divider-focus); - --color-menu-label: var(--dark-color-menu-label); - --color-panel: var(--dark-color-panel); - --color-panel-divider: var(--dark-color-panel-divider); - --color-comment-tag: var(--dark-color-comment-tag); - --color-comment-tag-text: var(--dark-color-comment-tag-text); - --color-ts: var(--dark-color-ts); - --color-ts-interface: var(--dark-color-ts-interface); - --color-ts-enum: var(--dark-color-ts-enum); - --color-ts-class: var(--dark-color-ts-class); - --color-ts-private: var(--dark-color-ts-private); - --color-toolbar: var(--dark-color-toolbar); - --color-toolbar-text: var(--dark-color-toolbar-text); - --icon-filter: var(--dark-icon-filter); - --external-icon: var(--dark-external-icon); -} - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -h2 { - font-size: 1.5em; - margin: 0.83em 0; -} - -h3 { - font-size: 1.17em; - margin: 1em 0; -} - -h4, -.tsd-index-panel h3 { - font-size: 1em; - margin: 1.33em 0; -} - -h5 { - font-size: 0.83em; - margin: 1.67em 0; -} - -h6 { - font-size: 0.67em; - margin: 2.33em 0; -} - -pre { - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; -} - -dl, -menu, -ol, -ul { - margin: 1em 0; -} - -dd { - margin: 0 0 0 40px; -} - -.container { - max-width: 1200px; - margin: 0 auto; - padding: 0 40px; -} -@media (max-width: 640px) { - .container { - padding: 0 20px; - } -} - -.container-main { - padding-bottom: 200px; -} - -.row { - display: flex; - position: relative; - margin: 0 -10px; -} -.row:after { - visibility: hidden; - display: block; - content: ""; - clear: both; - height: 0; -} - -.col-4, -.col-8 { - box-sizing: border-box; - float: left; - padding: 0 10px; -} - -.col-4 { - width: 33.3333333333%; -} -.col-8 { - width: 66.6666666667%; -} - -ul.tsd-descriptions > li > :first-child, -.tsd-panel > :first-child, -.col-8 > :first-child, -.col-4 > :first-child, -ul.tsd-descriptions > li > :first-child > :first-child, -.tsd-panel > :first-child > :first-child, -.col-8 > :first-child > :first-child, -.col-4 > :first-child > :first-child, -ul.tsd-descriptions > li > :first-child > :first-child > :first-child, -.tsd-panel > :first-child > :first-child > :first-child, -.col-8 > :first-child > :first-child > :first-child, -.col-4 > :first-child > :first-child > :first-child { - margin-top: 0; -} -ul.tsd-descriptions > li > :last-child, -.tsd-panel > :last-child, -.col-8 > :last-child, -.col-4 > :last-child, -ul.tsd-descriptions > li > :last-child > :last-child, -.tsd-panel > :last-child > :last-child, -.col-8 > :last-child > :last-child, -.col-4 > :last-child > :last-child, -ul.tsd-descriptions > li > :last-child > :last-child > :last-child, -.tsd-panel > :last-child > :last-child > :last-child, -.col-8 > :last-child > :last-child > :last-child, -.col-4 > :last-child > :last-child > :last-child { - margin-bottom: 0; -} - -@keyframes fade-in { - from { - opacity: 0; - } - to { - opacity: 1; - } -} -@keyframes fade-out { - from { - opacity: 1; - visibility: visible; - } - to { - opacity: 0; - } -} -@keyframes fade-in-delayed { - 0% { - opacity: 0; - } - 33% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@keyframes fade-out-delayed { - 0% { - opacity: 1; - visibility: visible; - } - 66% { - opacity: 0; - } - 100% { - opacity: 0; - } -} -@keyframes shift-to-left { - from { - transform: translate(0, 0); - } - to { - transform: translate(-25%, 0); - } -} -@keyframes unshift-to-left { - from { - transform: translate(-25%, 0); - } - to { - transform: translate(0, 0); - } -} -@keyframes pop-in-from-right { - from { - transform: translate(100%, 0); - } - to { - transform: translate(0, 0); - } -} -@keyframes pop-out-to-right { - from { - transform: translate(0, 0); - visibility: visible; - } - to { - transform: translate(100%, 0); - } -} -body { - background: var(--color-background); - font-family: "Segoe UI", sans-serif; - font-size: 16px; - color: var(--color-text); -} - -a { - color: var(--color-link); - text-decoration: none; -} -a:hover { - text-decoration: underline; -} -a.external[target="_blank"] { - background-image: var(--external-icon); - background-position: top 3px right; - background-repeat: no-repeat; - padding-right: 13px; -} - -code, -pre { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - padding: 0.2em; - margin: 0; - font-size: 14px; -} - -pre { - padding: 10px; -} -pre code { - padding: 0; - font-size: 100%; -} - -blockquote { - margin: 1em 0; - padding-left: 1em; - border-left: 4px solid gray; -} - -.tsd-typography { - line-height: 1.333em; -} -.tsd-typography ul { - list-style: square; - padding: 0 0 0 20px; - margin: 0; -} -.tsd-typography h4, -.tsd-typography .tsd-index-panel h3, -.tsd-index-panel .tsd-typography h3, -.tsd-typography h5, -.tsd-typography h6 { - font-size: 1em; - margin: 0; -} -.tsd-typography h5, -.tsd-typography h6 { - font-weight: normal; -} -.tsd-typography p, -.tsd-typography ul, -.tsd-typography ol { - margin: 1em 0; -} - -@media (min-width: 901px) and (max-width: 1024px) { - html .col-content { - width: 72%; - } - html .col-menu { - width: 28%; - } - html .tsd-navigation { - padding-left: 10px; - } -} -@media (max-width: 900px) { - html .col-content { - float: none; - width: 100%; - } - html .col-menu { - position: fixed !important; - overflow: auto; - -webkit-overflow-scrolling: touch; - z-index: 1024; - top: 0 !important; - bottom: 0 !important; - left: auto !important; - right: 0 !important; - width: 100%; - padding: 20px 20px 0 0; - max-width: 450px; - visibility: hidden; - background-color: var(--color-panel); - transform: translate(100%, 0); - } - html .col-menu > *:last-child { - padding-bottom: 20px; - } - html .overlay { - content: ""; - display: block; - position: fixed; - z-index: 1023; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.75); - visibility: hidden; - } - - .to-has-menu .overlay { - animation: fade-in 0.4s; - } - - .to-has-menu :is(header, footer, .col-content) { - animation: shift-to-left 0.4s; - } - - .to-has-menu .col-menu { - animation: pop-in-from-right 0.4s; - } - - .from-has-menu .overlay { - animation: fade-out 0.4s; - } - - .from-has-menu :is(header, footer, .col-content) { - animation: unshift-to-left 0.4s; - } - - .from-has-menu .col-menu { - animation: pop-out-to-right 0.4s; - } - - .has-menu body { - overflow: hidden; - } - .has-menu .overlay { - visibility: visible; - } - .has-menu :is(header, footer, .col-content) { - transform: translate(-25%, 0); - } - .has-menu .col-menu { - visibility: visible; - transform: translate(0, 0); - display: grid; - grid-template-rows: auto 1fr; - max-height: 100vh; - } - .has-menu .tsd-navigation { - max-height: 100%; - } -} - -.tsd-page-title { - padding: 70px 0 20px 0; - margin: 0 0 40px 0; - background: var(--color-panel); - box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); -} -.tsd-page-title h1 { - margin: 0; -} - -.tsd-breadcrumb { - margin: 0; - padding: 0; - color: var(--color-text-aside); -} -.tsd-breadcrumb a { - color: var(--color-text-aside); - text-decoration: none; -} -.tsd-breadcrumb a:hover { - text-decoration: underline; -} -.tsd-breadcrumb li { - display: inline; -} -.tsd-breadcrumb li:after { - content: " / "; -} - -dl.tsd-comment-tags { - overflow: hidden; -} -dl.tsd-comment-tags dt { - float: left; - padding: 1px 5px; - margin: 0 10px 0 0; - border-radius: 4px; - border: 1px solid var(--color-comment-tag); - color: var(--color-comment-tag); - font-size: 0.8em; - font-weight: normal; -} -dl.tsd-comment-tags dd { - margin: 0 0 10px 0; -} -dl.tsd-comment-tags dd:before, -dl.tsd-comment-tags dd:after { - display: table; - content: " "; -} -dl.tsd-comment-tags dd pre, -dl.tsd-comment-tags dd:after { - clear: both; -} -dl.tsd-comment-tags p { - margin: 0; -} - -.tsd-panel.tsd-comment .lead { - font-size: 1.1em; - line-height: 1.333em; - margin-bottom: 2em; -} -.tsd-panel.tsd-comment .lead:last-child { - margin-bottom: 0; -} - -.toggle-protected .tsd-is-private { - display: none; -} - -.toggle-public .tsd-is-private, -.toggle-public .tsd-is-protected, -.toggle-public .tsd-is-private-protected { - display: none; -} - -.toggle-inherited .tsd-is-inherited { - display: none; -} - -.toggle-externals .tsd-is-external { - display: none; -} - -#tsd-filter { - position: relative; - display: inline-block; - height: 40px; - vertical-align: bottom; -} -.no-filter #tsd-filter { - display: none; -} -#tsd-filter .tsd-filter-group { - display: inline-block; - height: 40px; - vertical-align: bottom; - white-space: nowrap; -} -#tsd-filter input { - display: none; -} -@media (max-width: 900px) { - #tsd-filter .tsd-filter-group { - display: block; - position: absolute; - top: 40px; - right: 20px; - height: auto; - background-color: var(--color-panel); - visibility: hidden; - transform: translate(50%, 0); - box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); - } - .has-options #tsd-filter .tsd-filter-group { - visibility: visible; - } - .to-has-options #tsd-filter .tsd-filter-group { - animation: fade-in 0.2s; - } - .from-has-options #tsd-filter .tsd-filter-group { - animation: fade-out 0.2s; - } - #tsd-filter label, - #tsd-filter .tsd-select { - display: block; - padding-right: 20px; - } -} - -footer { - border-top: 1px solid var(--color-panel-divider); - background-color: var(--color-panel); -} -footer.with-border-bottom { - border-bottom: 1px solid var(--color-panel-divider); -} -footer .tsd-legend-group { - font-size: 0; -} -footer .tsd-legend { - display: inline-block; - width: 25%; - padding: 0; - font-size: 16px; - list-style: none; - line-height: 1.333em; - vertical-align: top; -} -@media (max-width: 900px) { - footer .tsd-legend { - width: 50%; - } -} - -.tsd-hierarchy { - list-style: square; - padding: 0 0 0 20px; - margin: 0; -} -.tsd-hierarchy .target { - font-weight: bold; -} - -.tsd-index-panel .tsd-index-content { - margin-bottom: -30px !important; -} -.tsd-index-panel .tsd-index-section { - margin-bottom: 30px !important; -} -.tsd-index-panel h3 { - margin: 0 -20px 10px -20px; - padding: 0 20px 10px 20px; - border-bottom: 1px solid var(--color-panel-divider); -} -.tsd-index-panel ul.tsd-index-list { - -webkit-column-count: 3; - -moz-column-count: 3; - -ms-column-count: 3; - -o-column-count: 3; - column-count: 3; - -webkit-column-gap: 20px; - -moz-column-gap: 20px; - -ms-column-gap: 20px; - -o-column-gap: 20px; - column-gap: 20px; - padding: 0; - list-style: none; - line-height: 1.333em; -} -@media (max-width: 900px) { - .tsd-index-panel ul.tsd-index-list { - -webkit-column-count: 1; - -moz-column-count: 1; - -ms-column-count: 1; - -o-column-count: 1; - column-count: 1; - } -} -@media (min-width: 901px) and (max-width: 1024px) { - .tsd-index-panel ul.tsd-index-list { - -webkit-column-count: 2; - -moz-column-count: 2; - -ms-column-count: 2; - -o-column-count: 2; - column-count: 2; - } -} -.tsd-index-panel ul.tsd-index-list li { - -webkit-page-break-inside: avoid; - -moz-page-break-inside: avoid; - -ms-page-break-inside: avoid; - -o-page-break-inside: avoid; - page-break-inside: avoid; -} -.tsd-index-panel a, -.tsd-index-panel .tsd-parent-kind-module a { - color: var(--color-ts); -} -.tsd-index-panel .tsd-parent-kind-interface a { - color: var(--color-ts-interface); -} -.tsd-index-panel .tsd-parent-kind-enum a { - color: var(--color-ts-enum); -} -.tsd-index-panel .tsd-parent-kind-class a { - color: var(--color-ts-class); -} -.tsd-index-panel .tsd-kind-module a { - color: var(--color-ts); -} -.tsd-index-panel .tsd-kind-interface a { - color: var(--color-ts-interface); -} -.tsd-index-panel .tsd-kind-enum a { - color: var(--color-ts-enum); -} -.tsd-index-panel .tsd-kind-class a { - color: var(--color-ts-class); -} -.tsd-index-panel .tsd-is-private a { - color: var(--color-ts-private); -} - -.tsd-flag { - display: inline-block; - padding: 1px 5px; - border-radius: 4px; - color: var(--color-comment-tag-text); - background-color: var(--color-comment-tag); - text-indent: 0; - font-size: 14px; - font-weight: normal; -} - -.tsd-anchor { - position: absolute; - top: -100px; -} - -.tsd-member { - position: relative; -} -.tsd-member .tsd-anchor + h3 { - margin-top: 0; - margin-bottom: 0; - border-bottom: none; -} -.tsd-member [data-tsd-kind] { - color: var(--color-ts); -} -.tsd-member [data-tsd-kind="Interface"] { - color: var(--color-ts-interface); -} -.tsd-member [data-tsd-kind="Enum"] { - color: var(--color-ts-enum); -} -.tsd-member [data-tsd-kind="Class"] { - color: var(--color-ts-class); -} -.tsd-member [data-tsd-kind="Private"] { - color: var(--color-ts-private); -} - -.tsd-navigation { - margin: 0 0 0 40px; -} -.tsd-navigation a { - display: block; - padding-top: 2px; - padding-bottom: 2px; - border-left: 2px solid transparent; - color: var(--color-text); - text-decoration: none; - transition: border-left-color 0.1s; -} -.tsd-navigation a:hover { - text-decoration: underline; -} -.tsd-navigation ul { - margin: 0; - padding: 0; - list-style: none; -} -.tsd-navigation li { - padding: 0; -} - -.tsd-navigation.primary { - padding-bottom: 40px; -} -.tsd-navigation.primary a { - display: block; - padding-top: 6px; - padding-bottom: 6px; -} -.tsd-navigation.primary ul li a { - padding-left: 5px; -} -.tsd-navigation.primary ul li li a { - padding-left: 25px; -} -.tsd-navigation.primary ul li li li a { - padding-left: 45px; -} -.tsd-navigation.primary ul li li li li a { - padding-left: 65px; -} -.tsd-navigation.primary ul li li li li li a { - padding-left: 85px; -} -.tsd-navigation.primary ul li li li li li li a { - padding-left: 105px; -} -.tsd-navigation.primary > ul { - border-bottom: 1px solid var(--color-panel-divider); -} -.tsd-navigation.primary li { - border-top: 1px solid var(--color-panel-divider); -} -.tsd-navigation.primary li.current > a { - font-weight: bold; -} -.tsd-navigation.primary li.label span { - display: block; - padding: 20px 0 6px 5px; - color: var(--color-menu-label); -} -.tsd-navigation.primary li.globals + li > span, -.tsd-navigation.primary li.globals + li > a { - padding-top: 20px; -} - -.tsd-navigation.secondary { - max-height: calc(100vh - 1rem - 40px); - overflow: auto; - position: sticky; - top: calc(0.5rem + 40px); - transition: 0.3s; -} -.tsd-navigation.secondary.tsd-navigation--toolbar-hide { - max-height: calc(100vh - 1rem); - top: 0.5rem; -} -.tsd-navigation.secondary ul { - transition: opacity 0.2s; -} -.tsd-navigation.secondary ul li a { - padding-left: 25px; -} -.tsd-navigation.secondary ul li li a { - padding-left: 45px; -} -.tsd-navigation.secondary ul li li li a { - padding-left: 65px; -} -.tsd-navigation.secondary ul li li li li a { - padding-left: 85px; -} -.tsd-navigation.secondary ul li li li li li a { - padding-left: 105px; -} -.tsd-navigation.secondary ul li li li li li li a { - padding-left: 125px; -} -.tsd-navigation.secondary ul.current a { - border-left-color: var(--color-panel-divider); -} -.tsd-navigation.secondary li.focus > a, -.tsd-navigation.secondary ul.current li.focus > a { - border-left-color: var(--color-menu-divider-focus); -} -.tsd-navigation.secondary li.current { - margin-top: 20px; - margin-bottom: 20px; - border-left-color: var(--color-panel-divider); -} -.tsd-navigation.secondary li.current > a { - font-weight: bold; -} - -@media (min-width: 901px) { - .menu-sticky-wrap { - position: static; - } -} - -.tsd-panel { - margin: 20px 0; - padding: 20px; - background-color: var(--color-panel); - box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); -} -.tsd-panel:empty { - display: none; -} -.tsd-panel > h1, -.tsd-panel > h2, -.tsd-panel > h3 { - margin: 1.5em -20px 10px -20px; - padding: 0 20px 10px 20px; - border-bottom: 1px solid var(--color-panel-divider); -} -.tsd-panel > h1.tsd-before-signature, -.tsd-panel > h2.tsd-before-signature, -.tsd-panel > h3.tsd-before-signature { - margin-bottom: 0; - border-bottom: 0; -} -.tsd-panel table { - display: block; - width: 100%; - overflow: auto; - margin-top: 10px; - word-break: normal; - word-break: keep-all; - border-collapse: collapse; -} -.tsd-panel table th { - font-weight: bold; -} -.tsd-panel table th, -.tsd-panel table td { - padding: 6px 13px; - border: 1px solid var(--color-panel-divider); -} -.tsd-panel table tr { - background: var(--color-background); -} -.tsd-panel table tr:nth-child(even) { - background: var(--color-secondary-background); -} - -.tsd-panel-group { - margin: 60px 0; -} -.tsd-panel-group > h1, -.tsd-panel-group > h2, -.tsd-panel-group > h3 { - padding-left: 20px; - padding-right: 20px; -} - -#tsd-search { - transition: background-color 0.2s; -} -#tsd-search .title { - position: relative; - z-index: 2; -} -#tsd-search .field { - position: absolute; - left: 0; - top: 0; - right: 40px; - height: 40px; -} -#tsd-search .field input { - box-sizing: border-box; - position: relative; - top: -50px; - z-index: 1; - width: 100%; - padding: 0 10px; - opacity: 0; - outline: 0; - border: 0; - background: transparent; - color: var(--color-text); -} -#tsd-search .field label { - position: absolute; - overflow: hidden; - right: -40px; -} -#tsd-search .field input, -#tsd-search .title { - transition: opacity 0.2s; -} -#tsd-search .results { - position: absolute; - visibility: hidden; - top: 40px; - width: 100%; - margin: 0; - padding: 0; - list-style: none; - box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); -} -#tsd-search .results li { - padding: 0 10px; - background-color: var(--color-background); -} -#tsd-search .results li:nth-child(even) { - background-color: var(--color-panel); -} -#tsd-search .results li.state { - display: none; -} -#tsd-search .results li.current, -#tsd-search .results li:hover { - background-color: var(--color-panel-divider); -} -#tsd-search .results a { - display: block; -} -#tsd-search .results a:before { - top: 10px; -} -#tsd-search .results span.parent { - color: var(--color-text-aside); - font-weight: normal; -} -#tsd-search.has-focus { - background-color: var(--color-panel-divider); -} -#tsd-search.has-focus .field input { - top: 0; - opacity: 1; -} -#tsd-search.has-focus .title { - z-index: 0; - opacity: 0; -} -#tsd-search.has-focus .results { - visibility: visible; -} -#tsd-search.loading .results li.state.loading { - display: block; -} -#tsd-search.failure .results li.state.failure { - display: block; -} - -.tsd-signature { - margin: 0 0 1em 0; - padding: 10px; - border: 1px solid var(--color-panel-divider); - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - font-size: 14px; - overflow-x: auto; -} -.tsd-signature.tsd-kind-icon { - padding-left: 30px; -} -.tsd-signature.tsd-kind-icon:before { - top: 10px; - left: 10px; -} -.tsd-panel > .tsd-signature { - margin-left: -20px; - margin-right: -20px; - border-width: 1px 0; -} -.tsd-panel > .tsd-signature.tsd-kind-icon { - padding-left: 40px; -} -.tsd-panel > .tsd-signature.tsd-kind-icon:before { - left: 20px; -} - -.tsd-signature-symbol { - color: var(--color-text-aside); - font-weight: normal; -} - -.tsd-signature-type { - font-style: italic; - font-weight: normal; -} - -.tsd-signatures { - padding: 0; - margin: 0 0 1em 0; - border: 1px solid var(--color-panel-divider); -} -.tsd-signatures .tsd-signature { - margin: 0; - border-width: 1px 0 0 0; - transition: background-color 0.1s; -} -.tsd-signatures .tsd-signature:first-child { - border-top-width: 0; -} -.tsd-signatures .tsd-signature.current { - background-color: var(--color-panel-divider); -} -.tsd-signatures.active > .tsd-signature { - cursor: pointer; -} -.tsd-panel > .tsd-signatures { - margin-left: -20px; - margin-right: -20px; - border-width: 1px 0; -} -.tsd-panel > .tsd-signatures .tsd-signature.tsd-kind-icon { - padding-left: 40px; -} -.tsd-panel > .tsd-signatures .tsd-signature.tsd-kind-icon:before { - left: 20px; -} -.tsd-panel > a.anchor + .tsd-signatures { - border-top-width: 0; - margin-top: -20px; -} - -ul.tsd-descriptions { - position: relative; - overflow: hidden; - padding: 0; - list-style: none; -} -ul.tsd-descriptions.active > .tsd-description { - display: none; -} -ul.tsd-descriptions.active > .tsd-description.current { - display: block; -} -ul.tsd-descriptions.active > .tsd-description.fade-in { - animation: fade-in-delayed 0.3s; -} -ul.tsd-descriptions.active > .tsd-description.fade-out { - animation: fade-out-delayed 0.3s; - position: absolute; - display: block; - top: 0; - left: 0; - right: 0; - opacity: 0; - visibility: hidden; -} -ul.tsd-descriptions h4, -ul.tsd-descriptions .tsd-index-panel h3, -.tsd-index-panel ul.tsd-descriptions h3 { - font-size: 16px; - margin: 1em 0 0.5em 0; -} - -ul.tsd-parameters, -ul.tsd-type-parameters { - list-style: square; - margin: 0; - padding-left: 20px; -} -ul.tsd-parameters > li.tsd-parameter-signature, -ul.tsd-type-parameters > li.tsd-parameter-signature { - list-style: none; - margin-left: -20px; -} -ul.tsd-parameters h5, -ul.tsd-type-parameters h5 { - font-size: 16px; - margin: 1em 0 0.5em 0; -} -ul.tsd-parameters .tsd-comment, -ul.tsd-type-parameters .tsd-comment { - margin-top: -0.5em; -} - -.tsd-sources { - font-size: 14px; - color: var(--color-text-aside); - margin: 0 0 1em 0; -} -.tsd-sources a { - color: var(--color-text-aside); - text-decoration: underline; -} -.tsd-sources ul, -.tsd-sources p { - margin: 0 !important; -} -.tsd-sources ul { - list-style: none; - padding: 0; -} - -.tsd-page-toolbar { - position: fixed; - z-index: 1; - top: 0; - left: 0; - width: 100%; - height: 40px; - color: var(--color-toolbar-text); - background: var(--color-toolbar); - border-bottom: 1px solid var(--color-panel-divider); - transition: transform 0.3s linear; -} -.tsd-page-toolbar a { - color: var(--color-toolbar-text); - text-decoration: none; -} -.tsd-page-toolbar a.title { - font-weight: bold; -} -.tsd-page-toolbar a.title:hover { - text-decoration: underline; -} -.tsd-page-toolbar .table-wrap { - display: table; - width: 100%; - height: 40px; -} -.tsd-page-toolbar .table-cell { - display: table-cell; - position: relative; - white-space: nowrap; - line-height: 40px; -} -.tsd-page-toolbar .table-cell:first-child { - width: 100%; -} - -.tsd-page-toolbar--hide { - transform: translateY(-100%); -} - -.tsd-select .tsd-select-list li:before, -.tsd-select .tsd-select-label:before, -.tsd-widget:before { - content: ""; - display: inline-block; - width: 40px; - height: 40px; - margin: 0 -8px 0 0; - background-image: url(./widgets.png); - background-repeat: no-repeat; - text-indent: -1024px; - vertical-align: bottom; - filter: var(--icon-filter); -} -@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) { - .tsd-select .tsd-select-list li:before, - .tsd-select .tsd-select-label:before, - .tsd-widget:before { - background-image: url(./widgets@2x.png); - background-size: 320px 40px; - } -} - -.tsd-widget { - display: inline-block; - overflow: hidden; - opacity: 0.8; - height: 40px; - transition: opacity 0.1s, background-color 0.2s; - vertical-align: bottom; - cursor: pointer; -} -.tsd-widget:hover { - opacity: 0.9; -} -.tsd-widget.active { - opacity: 1; - background-color: var(--color-panel-divider); -} -.tsd-widget.no-caption { - width: 40px; -} -.tsd-widget.no-caption:before { - margin: 0; -} -.tsd-widget.search:before { - background-position: 0 0; -} -.tsd-widget.menu:before { - background-position: -40px 0; -} -.tsd-widget.options:before { - background-position: -80px 0; -} -.tsd-widget.options, -.tsd-widget.menu { - display: none; -} -@media (max-width: 900px) { - .tsd-widget.options, - .tsd-widget.menu { - display: inline-block; - } -} -input[type="checkbox"] + .tsd-widget:before { - background-position: -120px 0; -} -input[type="checkbox"]:checked + .tsd-widget:before { - background-position: -160px 0; -} - -.tsd-select { - position: relative; - display: inline-block; - height: 40px; - transition: opacity 0.1s, background-color 0.2s; - vertical-align: bottom; - cursor: pointer; -} -.tsd-select .tsd-select-label { - opacity: 0.6; - transition: opacity 0.2s; -} -.tsd-select .tsd-select-label:before { - background-position: -240px 0; -} -.tsd-select.active .tsd-select-label { - opacity: 0.8; -} -.tsd-select.active .tsd-select-list { - visibility: visible; - opacity: 1; - transition-delay: 0s; -} -.tsd-select .tsd-select-list { - position: absolute; - visibility: hidden; - top: 40px; - left: 0; - margin: 0; - padding: 0; - opacity: 0; - list-style: none; - box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); - transition: visibility 0s 0.2s, opacity 0.2s; -} -.tsd-select .tsd-select-list li { - padding: 0 20px 0 0; - background-color: var(--color-background); -} -.tsd-select .tsd-select-list li:before { - background-position: 40px 0; -} -.tsd-select .tsd-select-list li:nth-child(even) { - background-color: var(--color-panel); -} -.tsd-select .tsd-select-list li:hover { - background-color: var(--color-panel-divider); -} -.tsd-select .tsd-select-list li.selected:before { - background-position: -200px 0; -} -@media (max-width: 900px) { - .tsd-select .tsd-select-list { - top: 0; - left: auto; - right: 100%; - margin-right: -5px; - } - .tsd-select .tsd-select-label:before { - background-position: -280px 0; - } -} - -img { - max-width: 100%; -} diff --git a/docs/api/assets/widgets.png b/docs/api/assets/widgets.png deleted file mode 100644 index c7380532a..000000000 Binary files a/docs/api/assets/widgets.png and /dev/null differ diff --git a/docs/api/assets/widgets@2x.png b/docs/api/assets/widgets@2x.png deleted file mode 100644 index 4bbbd5727..000000000 Binary files a/docs/api/assets/widgets@2x.png and /dev/null differ diff --git a/docs/api/classes/Configs.html b/docs/api/classes/Configs.html deleted file mode 100644 index 7aa0a1dce..000000000 --- a/docs/api/classes/Configs.html +++ /dev/null @@ -1,79 +0,0 @@ -Configs | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu
-

Configs is an in-memory document store for Kubernetes objects populated from/to configuration files.

-

It enables performing rich query and mutation operations.

-

Hierarchy

  • Configs

Index

Constructors

constructor

  • -

    Creates a Config.

    -

    Parameters

    • input: KubernetesObject[] = []
      -

      Input Kubernetes objects. -If supplied multiple objects with the same kubernetesKey discards all but the last one. -Does not preserve insertion order of the given objects.

      -
    • Optional functionConfig: KubernetesObject
      -

      Kubernetes object used to parameterize the function's behavior.

      -
    • Optional results: Result[]
      -

      For testing only: List of Results returned by the function.

      -

    Returns Configs

Properties

logToStdErr

logToStdErr: undefined | boolean
-

Determines whether addResults should also log to stderr.

-

Methods

addResults

  • addResults(...results: Result[]): void
  • -

    Adds given result(s) representing structured findings by the function.

    -

    Parameters

    Returns void

deepCopy

delete

  • -

    Deletes all objects with the same kubernetesKey as any of the given objects.

    -

    Does not throw if given duplicates or keys which are not present in the Configs.

    -

    Parameters

    Returns void

deleteAll

  • deleteAll(): void

get

  • -

    Returns an array of objects matching the given Kind type predicate.

    -

    Casts to an array of Kind. May throw if isKind is incorrect.

    -

    The ordering of objects is deterministic.

    -

    Returned objects are pass-by-reference; mutating them results in changes being persisted.

    -

    Type parameters

    Parameters

    Returns Kind[]

getAll

  • -

    Returns an array of all the objects in this Configs.

    -

    The ordering of objects is deterministic.

    -

    Returned objects are pass-by-reference; mutating them results in changes being persisted.

    -

    Returns KubernetesObject[]

getFunctionConfig

getFunctionConfigMap

  • getFunctionConfigMap(): undefined | Map<string, string>
  • -

    Returns the map of data values if functionConfig is of kind ConfigMap.

    -

    Throws a FunctionConfigError if functionConfig is undefined OR -if the kind is not a v1/ConfigMap.

    -

    Returns undefined | Map<string, string>

getFunctionConfigValue

  • getFunctionConfigValue(key: string): undefined | string
  • -

    Returns the value for the given key if functionConfig is of kind ConfigMap.

    -

    Throws a FunctionConfigError if functionConfig kind is not a ConfigMap.

    -

    Returns undefined if functionConfig is undefined OR -if the ConfigMap has no such key in the 'data' section.

    -
    key

    key The key in the 'data' field in the ConfigMap object given as the functionConfig.

    -

    Parameters

    • key: string

    Returns undefined | string

getFunctionConfigValueOrThrow

  • getFunctionConfigValueOrThrow(key: string): string

getResults

  • -

    Get result(s) representing structured findings by the function.

    -

    Returns Result[]

groupBy

  • -

    Partitions the objects using the provided key function

    -

    The ordering of objects with the same key is deterministic.

    -

    Example: Partition configs by Namespace:

    -
    const configsByNamespace = configs.groupBy((o) => o.metadata.namespace)
    -
    -

    Parameters

    Returns [string, KubernetesObject[]][]

hasUnexpectedFunctionParameter

  • hasUnexpectedFunctionParameter(expectedDataKeys: string[]): undefined | string[]
  • -

    Detects if an unknown value has been provided to the config map

    -

    Parameters

    • expectedDataKeys: string[]
      -

      The set of keys expected in the Configs data

      -

    Returns undefined | string[]

    Returns undefined if the config map is undefined. Otherwise -returns a string[] containing the invalid keys. The string[] will be empty -if all of the config maps keys are members of the expecteKeys.

    -

insert

  • -

    Inserts objects into the Configs.

    -

    If another object already in Configs has the same kubernetesKey, replaces that one with the -given object.

    -

    If inserting multiple objects with the same kubernetesKey, discards all but the last one.

    -

    Does not preserve insertion order of the given objects.

    -

    Parameters

    Returns void

toResourceList

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/classes/FunctionConfigError.html b/docs/api/classes/FunctionConfigError.html deleted file mode 100644 index 647579181..000000000 --- a/docs/api/classes/FunctionConfigError.html +++ /dev/null @@ -1,3 +0,0 @@ -FunctionConfigError | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FunctionConfigError

-

Represents an error with the functionConfig used to parametrize the function.

-

Hierarchy

  • Error
    • FunctionConfigError

Index

Constructors

Constructors

constructor

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/classes/ResourceList.html b/docs/api/classes/ResourceList.html deleted file mode 100644 index b110156d8..000000000 --- a/docs/api/classes/ResourceList.html +++ /dev/null @@ -1,8 +0,0 @@ -ResourceList | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ResourceList

-

ResourceList is the wire format for the output of the kpt function as defined by the spec: -https://github.com/kubernetes-sigs/kustomize/blob/master/cmd/config/docs/api-conventions/functions-spec.md

-

Hierarchy

  • ResourceList

Implements

Index

Constructors

constructor

Properties

Readonly apiVersion

apiVersion: "config.kubernetes.io/v1" = 'config.kubernetes.io/v1'

Readonly items

Readonly kind

kind: "ResourceList" = 'ResourceList'

Readonly metadata

metadata: { name: string } = ...

Type declaration

  • name: string

Optional Readonly results

results?: Result[]

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/classes/TestRunner.html b/docs/api/classes/TestRunner.html deleted file mode 100644 index 0833a6a6f..000000000 --- a/docs/api/classes/TestRunner.html +++ /dev/null @@ -1,38 +0,0 @@ -TestRunner | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TestRunner

-

TestRunner makes it easy to write unit tests for kpt functions.

-

Hierarchy

  • TestRunner

Index

Constructors

constructor

Methods

assert

  • assert(input?: Configs, expectedOutput?: Configs | "unchanged", expectedErrorType?: new (...args: any[]) => Error, expectedErrorMessage?: string | RegExp): Promise<void>
  • -

    Runs the KptFunc and asserts the expected output or error.

    -

    Example usage:

    -
    const RUNNER = new TestRunner(myFunc);

    it('function is a NO OP', async () => {
    await RUNNER.assert());
    }; -
    -

    Parameters

    • input: Configs = ...
      -

      input Configs passed to the function. It is deep-copied before running the function. - If undefined, assumes an empty Configs.

      -
    • Optional expectedOutput: Configs | "unchanged"
      -

      expected resultant Configs after running the function regardless of success or failure. - Use 'unchanged' if the function is not expected to change input Configs.

      -
    • Optional expectedErrorType: new (...args: any[]) => Error
      -

      expected error type to be thrown.

      -
        • new (...args: any[]): Error
        • Parameters

          • Rest ...args: any[]

          Returns Error

    • Optional expectedErrorMessage: string | RegExp
      -

      expected message of expection to be thrown.

      -

    Returns Promise<void>

assertCallback

  • assertCallback(input?: Configs, expectedOutput?: Configs | "unchanged", expectedErrorType?: new (...args: any[]) => Error, expectedErrorMessage?: string | RegExp): () => Promise<void>
  • -

    Similar to assert method, but instead returns an assertion function that can be passed directly to 'it'.

    -

    Example usage:

    -
    const RUNNER = new TestRunner(myFunc);

    it('function is a NO OP', RUNNER.assertCallback()); -
    -

    Parameters

    • input: Configs = ...
      -

      input Configs passed to the function. It is deep-copied before running the function. - If undefined, assumes an empty Configs.

      -
    • Optional expectedOutput: Configs | "unchanged"
      -

      expected resultant Configs after running the function regardless of success or failure. - Use 'unchanged' if the function is not expected to change input Configs.

      -
    • Optional expectedErrorType: new (...args: any[]) => Error
      -

      expected error type to be thrown.

      -
        • new (...args: any[]): Error
        • Parameters

          • Rest ...args: any[]

          Returns Error

    • Optional expectedErrorMessage: string | RegExp
      -

      expected message of expection to be thrown.

      -

    Returns () => Promise<void>

      • (): Promise<void>
      • -

        Similar to assert method, but instead returns an assertion function that can be passed directly to 'it'.

        -

        Example usage:

        -
        const RUNNER = new TestRunner(myFunc);

        it('function is a NO OP', RUNNER.assertCallback()); -
        -

        Returns Promise<void>

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/index.html b/docs/api/index.html deleted file mode 100644 index aababc671..000000000 --- a/docs/api/index.html +++ /dev/null @@ -1,64 +0,0 @@ -kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

kpt-functions

Index

Type aliases

Json

Json: null | boolean | number | string | JsonArray | JsonMap
-

Any plain old JSON value according to ECMA-404.

-

Severity

Severity: "error" | "warn" | "info"
-

Severity of a configuration result.

-

Variables

ANNOTATION_PREFIX

ANNOTATION_PREFIX: "internal.config.kubernetes.io" = 'internal.config.kubernetes.io'

ID_ANNOTATION

ID_ANNOTATION: string = ...

LEGACY_ANNOTATION_PREFIX

LEGACY_ANNOTATION_PREFIX: "config.kubernetes.io" = 'config.kubernetes.io'

LEGACY_ID_ANNOTATION

LEGACY_ID_ANNOTATION: "config.k8s.io/id" = ...

LEGACY_SOURCE_INDEX_ANNOTATION

LEGACY_SOURCE_INDEX_ANNOTATION: string = ...

LEGACY_SOURCE_PATH_ANNOTATION

LEGACY_SOURCE_PATH_ANNOTATION: string = ...

SOURCE_INDEX_ANNOTATION

SOURCE_INDEX_ANNOTATION: string = ...

SOURCE_PATH_ANNOTATION

SOURCE_PATH_ANNOTATION: string = ...

Functions

addAnnotation

  • -

    Add an annotation to a KubernetesObject's metadata. Overwrites the previously existing annotation if it exists. -Return the resulting object.

    -

    Parameters

    • o: KubernetesObject
      -

      The object to add the annotation to.

      -
    • annotation: string
      -

      The annotation to set.

      -
    • value: string
      -

      The value to set the annotation to.

      -

    Returns KubernetesObject

addLabel

  • -

    Add a label to a KubernetesObject's metadata. Overwrites the previously existing label if it exists. -Return the resulting object.

    -

    Parameters

    • o: KubernetesObject
      -

      The object to add the label to.

      -
    • label: string
      -

      The label to set.

      -
    • value: string
      -

      The value to set the label to.

      -

    Returns KubernetesObject

configFileResult

  • configFileResult(message: string, path: string, severity?: Severity, tags?: {}): Result
  • -

    A result relating to a configuration file.

    -

    Parameters

    • message: string
    • path: string
    • severity: Severity = 'error'
    • Optional tags: {}
      • [key: string]: string

    Returns Result

generalResult

  • generalResult(message: string, severity?: Severity, tags?: {}): Result

getAnnotation

  • -

    Get the value of the object's annotation, or undefined if it is not set.

    -

    Parameters

    • o: KubernetesObject
      -

      The object to get the annotation from.

      -
    • annotation: string
      -

      The annotation to get.

      -

    Returns string | undefined

getLabel

  • -

    Get the value of the object's label, or undefined if it is not set.

    -

    Parameters

    • o: KubernetesObject
      -

      The object to get the label from.

      -
    • label: string
      -

      The label to get.

      -

    Returns string | undefined

isKubernetesObject

kubernetesKey

  • -

    A unique key for a Kubernetes object defined as tuple of (apiVersion, kind, namespace, name).

    -

    Parameters

    Returns string

kubernetesObjectResult

removeAnnotation

  • -

    Remove an annotation from a KubernetesObject's metadata. If the resulting metadata.annotations is empty, removes -it. Return the resulting object.

    -

    Parameters

    • o: KubernetesObject
      -

      The object to remove the annotation from.

      -
    • annotation: string
      -

      The annotation to remove.

      -

    Returns KubernetesObject

removeLabel

  • -

    Remove a label from a KubernetesObject's metadata. If the resulting metadata.labels is empty, removes -it. Return the resulting object.

    -

    Parameters

    • o: KubernetesObject
      -

      The object to remove the label from.

      -
    • label: string
      -

      The label to remove.

      -

    Returns KubernetesObject

run

  • -

    This is the main entrypoint for running a kpt function.

    -

    This method does not throw any errors and can be invoked at the top-level without getting -an unhandled promise rejection error.

    -

    Parameters

    Returns Promise<void>

runFnWithConfigs

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/interfaces/FieldInfo.html b/docs/api/interfaces/FieldInfo.html deleted file mode 100644 index 25e04d36f..000000000 --- a/docs/api/interfaces/FieldInfo.html +++ /dev/null @@ -1,3 +0,0 @@ -FieldInfo | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FieldInfo

-

Metadata about a specific field in a Kubernetes object.

-

Hierarchy

  • FieldInfo

Index

Properties

Optional currentValue

currentValue?: Json

path

path: string

Optional suggestedValue

suggestedValue?: Json

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/interfaces/JsonArray.html b/docs/api/interfaces/JsonArray.html deleted file mode 100644 index 1713f622c..000000000 --- a/docs/api/interfaces/JsonArray.html +++ /dev/null @@ -1,3 +0,0 @@ -JsonArray | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface JsonArray

-

A plain old JSON array according to ECMA-404.

-

Hierarchy

  • Array<Json>
    • JsonArray

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/interfaces/JsonMap.html b/docs/api/interfaces/JsonMap.html deleted file mode 100644 index b099f7368..000000000 --- a/docs/api/interfaces/JsonMap.html +++ /dev/null @@ -1,3 +0,0 @@ -JsonMap | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface JsonMap

-

A plain old JSON object/map according to ECMA-404.

-

Hierarchy

  • JsonMap

Indexable

[field: string]: Json

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/interfaces/KptFunc.html b/docs/api/interfaces/KptFunc.html deleted file mode 100644 index aed6c5ef2..000000000 --- a/docs/api/interfaces/KptFunc.html +++ /dev/null @@ -1,11 +0,0 @@ -KptFunc | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface KptFunc

Hierarchy

  • KptFunc

Callable

  • KptFunc(configs: Configs): Promise<void>
  • -

    A function consumes and optionally mutates Kubernetes configurations using the given Configs object.

    -

    The function should:

    -
      -
    • Throw errors when encountering operational issues such as IO exceptions.
    • -
    • Avoid writing to stdout (e.g. using process.stdout) as it is used for chaining functions. -Use stderr instead.
    • -
    -

    Parameters

    Returns Promise<void>

Index

Properties

Properties

usage

usage: string
-

Usage message describing what the function does, how to use it, and how to configure it.

-

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/interfaces/KubernetesObject.html b/docs/api/interfaces/KubernetesObject.html deleted file mode 100644 index a7a3c7c9d..000000000 --- a/docs/api/interfaces/KubernetesObject.html +++ /dev/null @@ -1,3 +0,0 @@ -KubernetesObject | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface KubernetesObject

-

Interface implemented by Kubernetes objects.

-

Hierarchy

  • KubernetesObject

Implemented by

Index

Properties

apiVersion

apiVersion: string

kind

kind: string

metadata

metadata: ObjectMeta

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/api/interfaces/Result.html b/docs/api/interfaces/Result.html deleted file mode 100644 index 07148d9b3..000000000 --- a/docs/api/interfaces/Result.html +++ /dev/null @@ -1,9 +0,0 @@ -Result | kpt-functions
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Result

-

Result represents a configuration-related issue returned by a function.

-

It can be at the following granularities:

-
    -
  • A file containing multiple objects
  • -
  • A specific kubernetes object
  • -
  • A specific field of a kubernetes object
  • -
-

Hierarchy

  • Result

Index

Properties

Optional field

field?: FieldInfo

Optional file

file?: { index?: number; path?: string }

Type declaration

  • Optional index?: number
  • Optional path?: string

message

message: string

Optional resourceRef

resourceRef?: { apiVersion: string; kind: string; name: string; namespace: string }

Type declaration

  • apiVersion: string
  • kind: string
  • name: string
  • namespace: string

severity

severity: Severity

Optional tags

tags?: {}

Type declaration

  • [key: string]: string

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/containerizing.md b/docs/containerizing.md new file mode 100644 index 000000000..de73504f2 --- /dev/null +++ b/docs/containerizing.md @@ -0,0 +1,136 @@ +# Containerizing KRM Functions + +KRM functions are distributed as container images. This guide covers building +and running containerized functions. + +## Dockerfile + +The [krm-functions-catalog](https://github.com/kptdev/krm-functions-catalog) +provides a shared Dockerfile at `build/docker/go/Dockerfile` that all the catalog +functions use. It accepts `BUILDER_IMAGE` and `BASE_IMAGE` as build args. + +For standalone functions or local development, use a multi-stage build with a +minimal base image. The function binary should be statically linked (no CGO), so +it can run on `scratch` or `distroless`: + +```dockerfile +FROM golang:1.26-alpine AS builder +ENV CGO_ENABLED=0 +WORKDIR /go/src/ +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN go build -o /usr/local/bin/function ./ + +FROM scratch +COPY --from=builder /usr/local/bin/function /usr/local/bin/function +ENTRYPOINT ["function"] +``` + +Key points: +- `CGO_ENABLED=0` produces a static binary that runs on `scratch`. +- The `scratch` base image has zero overhead — no shell, no OS packages. +- If you need TLS certificates (e.g., for network calls), use `gcr.io/distroless/static` instead of `scratch`. +- Copy only the binary to the final image to minimize size. + +### Alternative with distroless + +```dockerfile +FROM golang:1.26-alpine AS builder +ENV CGO_ENABLED=0 +WORKDIR /go/src/ +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN go build -o /usr/local/bin/function ./ + +FROM gcr.io/distroless/static:nonroot +COPY --from=builder /usr/local/bin/function /usr/local/bin/function +ENTRYPOINT ["function"] +``` + +## Building + +```bash +docker build -t ghcr.io/kptdev/krm-functions-catalog/my-function:v0.1 . +``` + +### Image Naming Convention + +Follow this pattern for function images: + +``` +ghcr.io/kptdev/krm-functions-catalog/{function-name}:{version} +``` + +Examples: +- `ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1` +- `ghcr.io/kptdev/krm-functions-catalog/enforce-namespace:v1.0` +- `ghcr.io/kptdev/krm-functions-catalog/generate-configmap:v0.3` + +Use semantic versioning for tags. Avoid `latest` in production pipelines. + +## Running + +KRM functions read from STDIN and write to STDOUT: + +```bash +docker run --rm -i ghcr.io/kptdev/krm-functions-catalog/my-function:v0.1 < input.yaml > output.yaml +``` + +### With file mode + +```bash +docker run --rm -v $(pwd):/data ghcr.io/kptdev/krm-functions-catalog/my-function:v0.1 /data/deployment.yaml +``` + +### Help and doc flags + +```bash +docker run --rm ghcr.io/kptdev/krm-functions-catalog/my-function:v0.1 --help +docker run --rm ghcr.io/kptdev/krm-functions-catalog/my-function:v0.1 --doc +``` + +## Using with kpt + +In a `Kptfile` pipeline, `kpt fn render` will pull the image from the registry +and run it against your package resources: + +```yaml +apiVersion: kpt.dev/v1 +kind: Kptfile +metadata: + name: my-package +pipeline: + mutators: + - image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1 + configMap: + app: my-app + validators: + - image: ghcr.io/kptdev/krm-functions-catalog/enforce-namespace:v1.0 + configMap: + namespace: production +``` + +Note: the image must be published and accessible from the machine running +`kpt fn render`. For local development, build the image locally first. It +will be used from the local Docker cache without pulling. + +## Tips + +- Keep images small — a typical Go KRM function image is 5–15 MB with `scratch`. +- Pin dependency versions in `go.mod` for reproducible builds. +- Use `.dockerignore` to exclude test data, docs, and other non-build files. +- Test the container locally before publishing: + ```bash + echo '{"apiVersion":"config.kubernetes.io/v1","kind":"ResourceList","items":[]}' | \ + docker run --rm -i ghcr.io/kptdev/krm-functions-catalog/my-function:v0.1 + ``` + +## Publishing + +Publishing function images to a registry is handled by the +[krm-functions-catalog](https://github.com/kptdev/krm-functions-catalog) +CI pipeline. See the catalog's +[CONTRIBUTING.md](https://github.com/kptdev/krm-functions-catalog/blob/main/CONTRIBUTING.md) +for the release workflow. \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 6b76b1e2a..000000000 --- a/docs/index.html +++ /dev/null @@ -1,5 +0,0 @@ - - -Redirecting to https://googlecontainertools.github.io/kpt - - \ No newline at end of file diff --git a/docs/interfaces.md b/docs/interfaces.md new file mode 100644 index 000000000..d133fd5f6 --- /dev/null +++ b/docs/interfaces.md @@ -0,0 +1,178 @@ +# Interfaces + +The SDK provides two interfaces for implementing KRM functions. Choose according +to your function requirements. + +## fn.Runner + +Use `fn.Runner` for **transformers** (mutators) and **validators**. This is the +recommended interface for most functions. + +```go +type Runner interface { + Run(context *Context, functionConfig *KubeObject, items KubeObjects, results *Results) bool +} +``` + +Characteristics: +- The SDK automatically parses `functionConfig` into your struct's exported fields (via JSON tags). +- You can **modify** existing items, but you cannot add or remove items from the slice. +- Return `true` for success, `false` for failure. +- Use `results` to report structured info/warning/error messages. + +### Example: Validator + +```go +var _ fn.Runner = &EnforceNamespace{} + +type EnforceNamespace struct { + Namespace string `json:"namespace"` +} + +func (r *EnforceNamespace) Run(ctx *fn.Context, functionConfig *fn.KubeObject, items fn.KubeObjects, results *fn.Results) bool { + for _, obj := range items { + if obj.GetNamespace() != r.Namespace { + results.Errorf("resource %s/%s has namespace %q, expected %q", + obj.GetKind(), obj.GetName(), obj.GetNamespace(), r.Namespace) + } + } + return results.ExitCode() == 0 +} + +func main() { + runner := fn.WithContext(context.Background(), &EnforceNamespace{}) + if err := fn.AsMain(runner); err != nil { + os.Exit(1) + } +} +``` + +### Example: Transformer (Mutator) + +```go +var _ fn.Runner = &SetAnnotations{} + +type SetAnnotations struct { + Annotations map[string]string `json:"annotations,omitempty"` +} + +func (r *SetAnnotations) Run(ctx *fn.Context, functionConfig *fn.KubeObject, items fn.KubeObjects, results *fn.Results) bool { + for _, obj := range items { + for k, v := range r.Annotations { + if err := obj.SetAnnotation(k, v); err != nil { + results.ErrorE(err) + } + } + } + return results.ExitCode() == 0 +} +``` + +## fn.ResourceListProcessor + +Use `fn.ResourceListProcessor` for **generators** and **complex functions** that +need full control over the ResourceList. + +```go +type ResourceListProcessor interface { + Process(rl *ResourceList) (bool, error) +} +``` + +Characteristics: +- Full access to `ResourceList.Items` — you can add, remove, or modify items. +- You must parse `functionConfig` manually from `rl.FunctionConfig`. +- You can modify `rl.Results` directly. +- Return `(true, nil)` for success, `(false, err)` for failure. + +### Example: Generator + +```go +type ConfigMapGenerator struct{} + +func (g *ConfigMapGenerator) Process(rl *fn.ResourceList) (bool, error) { + // Parse functionConfig manually + name, _, _ := rl.FunctionConfig.NestedString("metadata", "name") + + // Generate a new ConfigMap + cm := fn.NewEmptyKubeObject() + if err := cm.SetAPIVersion("v1"); err != nil { + return false, err + } + if err := cm.SetKind("ConfigMap"); err != nil { + return false, err + } + if err := cm.SetName(name + "-generated"); err != nil { + return false, err + } + if err := cm.SetNamespace("default"); err != nil { + return false, err + } + + // Add to items + rl.Items = append(rl.Items, cm) + return true, nil +} + +func main() { + if err := fn.AsMain(&ConfigMapGenerator{}); err != nil { + os.Exit(1) + } +} +``` + +### ResourceListProcessorFunc + +For simple cases, use the function adapter instead of defining a struct: + +```go +type ResourceListProcessorFunc func(rl *ResourceList) (bool, error) +``` + +Example: + +```go +func main() { + processor := fn.ResourceListProcessorFunc(func(rl *fn.ResourceList) (bool, error) { + for _, obj := range rl.Items { + if err := obj.SetLabel("managed-by", "my-function"); err != nil { + return false, err + } + } + return true, nil + }) + if err := fn.AsMain(processor); err != nil { + os.Exit(1) + } +} +``` + +## Choosing Between Interfaces + +| Capability | fn.Runner | fn.ResourceListProcessor | +|---|---|---| +| Auto-parse functionConfig | ✅ | ❌ (manual) | +| Modify existing items | ✅ | ✅ | +| Add new items | ❌ | ✅ | +| Remove items | ❌ | ✅ | +| Access full ResourceList | ❌ | ✅ | +| Best for | Transformers, Validators | Generators, Complex functions | + +## Wrapping a Runner + +`fn.Runner` is wrapped into a `ResourceListProcessor` internally using +`fn.WithContext`: + +```go +runner := fn.WithContext(context.Background(), &MyFunction{}) +// runner implements ResourceListProcessor and can be passed to fn.AsMain +``` + +This wrapper handles the following: +1. Parsing `functionConfig` into your struct fields +2. Calling your `Run` method with the parsed context +3. Collecting results and determining success/failure + +--- + +Next: [Testing](testing.md) — golden test patterns for verifying your function. diff --git a/docs/testing.md b/docs/testing.md new file mode 100644 index 000000000..fe27f140d --- /dev/null +++ b/docs/testing.md @@ -0,0 +1,217 @@ +# Testing KRM Functions + +The SDK provides a golden test framework in `fn/testhelpers` for snapshot-based +testing of KRM functions. + +## Golden Test Pattern + +Golden tests compare the function output against the expected baseline files. This +approach catches regressions and makes it easy to review output changes. + +### Directory Structure + +``` +testdata/ +├── test-case-1/ +│ ├── _expected.yaml # Expected output (full ResourceList YAML) +│ ├── _fnconfig.yaml # FunctionConfig for this test case +│ └── resources.yaml # Input KRM resources +└── test-case-2/ + ├── _expected.yaml + ├── _fnconfig.yaml + └── resources.yaml +``` + +Conventions: +- Files prefixed with `_` are special — they are not included in the input items. +- `_fnconfig.yaml` contains the functionConfig passed to your function. +- `_expected.yaml` contains the expected ResourceList output. +- All other `.yaml` files in the directory are parsed as input resources. +- You can have multiple input files (e.g., `deployments.yaml`, `services.yaml`). + +### Writing a Golden Test + +```go +package main + +import ( + "context" + "testing" + + "github.com/kptdev/krm-functions-sdk/go/fn" + "github.com/kptdev/krm-functions-sdk/go/fn/testhelpers" +) + +func TestFunction(t *testing.T) { + runner := fn.WithContext(context.TODO(), &YourFunction{}) + testhelpers.RunGoldenTests(t, "testdata", runner) +} +``` + +`RunGoldenTests` will: +1. Discover all subdirectories under `testdata/`. +2. For each subdirectory, parse all non-`_` prefixed YAML files as input items. +3. Parse `_fnconfig.yaml` as the functionConfig. +4. Run your processor against the assembled ResourceList. +5. Compare the output against `_expected.yaml`. + +### Example Test Data + +The following example is illustrative — it shows what test data looks like for a +function that sets labels. The [`go/get-started/`](../go/get-started/) example +provides a minimal working skeleton you can build from. + +`testdata/add-labels/_fnconfig.yaml`: +```yaml +apiVersion: fn.kpt.dev/v1alpha1 +kind: SetLabels +metadata: + name: my-config +labels: + app: my-app +``` + +`testdata/add-labels/resources.yaml`: +```yaml +apiVersion: v1 +kind: Service +metadata: + name: my-service +spec: + selector: + app: my-app +``` + +`testdata/add-labels/_expected.yaml`: +```yaml +apiVersion: config.kubernetes.io/v1 +kind: ResourceList +items: +- apiVersion: v1 + kind: Service + metadata: + name: my-service + labels: + app: my-app + spec: + selector: + app: my-app +functionConfig: + apiVersion: fn.kpt.dev/v1alpha1 + kind: SetLabels + metadata: + name: my-config + labels: + app: my-app +results: +- message: updated labels + severity: info +``` + +## Running Tests + +From your function's module root (where `go.mod` lives): + +```bash +go test ./... +``` + +If the function output does not match `_expected.yaml`, the test fails with a +diff showing what changed. See [`go/get-started/`](../go/get-started/) for a +complete working example. + +## Updating Expected Output + +When your function's output changes intentionally, regenerate the expected files: + +```bash +WRITE_GOLDEN_OUTPUT=1 go test ./... +``` + +This overwrites all `_expected.yaml` files with the actual output. Review the +diffs in version control before committing. + +**Caution:** `WRITE_GOLDEN_OUTPUT` accepts whatever the function currently +produces as "correct." If the function has a bug, you have just blessed buggy +output. Golden tests verify *stability* (did the output change?), not +*correctness* (is the output right?). Always review the diffs carefully. +For correctness guarantees, complement golden tests with property-based tests +that assert invariants (e.g., "all resources have the expected label"). + +Note: other kpt ecosystem projects use different env var names for the same +purpose (`KPT_E2E_UPDATE_EXPECTED` in kpt, `UPDATE_GOLDEN_FILES` in porch). +`WRITE_GOLDEN_OUTPUT` is the standard for the SDK and catalog functions. + +## Testing a ResourceListProcessor + +`RunGoldenTests` accepts any `fn.ResourceListProcessor`, so it works with both +`fn.Runner` (wrapped via `fn.WithContext`) and direct `ResourceListProcessor` +implementations: + +```go +func TestGenerator(t *testing.T) { + testhelpers.RunGoldenTests(t, "testdata", &MyGenerator{}) +} +``` + +## Unit Testing Without Golden Files + +For simpler unit tests, you can construct a ResourceList directly: + +```go +func TestSetLabels(t *testing.T) { + input := []byte(` +apiVersion: config.kubernetes.io/v1 +kind: ResourceList +items: +- apiVersion: v1 + kind: ConfigMap + metadata: + name: test +functionConfig: + apiVersion: fn.kpt.dev/v1alpha1 + kind: SetLabels + labels: + env: prod +`) + runner := fn.WithContext(context.TODO(), &SetLabels{}) + output, err := fn.Run(runner, input) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + rl, err := fn.ParseResourceList(output) + if err != nil { + t.Fatalf("failed to parse output: %v", err) + } + + label, _, _ := rl.Items[0].NestedString("metadata", "labels", "env") + if label != "prod" { + t.Errorf("expected label env=prod, got %q", label) + } +} +``` + +## Tips + +- Keep test cases focused — one behavior per test directory. +- Use descriptive directory names (e.g., `empty-input`, `missing-namespace`, `multiple-resources`). +- The `_fnconfig.yaml` can be empty if your function doesn't require configuration. +- Golden tests also catch unintentional formatting changes. This helps to maintain a stable output. + +## End-to-End Testing + +The SDK's `testhelpers.RunGoldenTests` tests function logic in isolation — no +container, no kpt CLI. For full integration testing (container execution, +`kpt fn eval`/`kpt fn render` pipelines), the kpt repo provides a separate e2e +test runner at +[`pkg/test/runner`](https://github.com/kptdev/kpt/tree/main/pkg/test/runner). + +The e2e runner uses a different test structure (`.expected/` directories with +`config.yaml`, `diff.patch`, `results.yaml`) and is used by the +[krm-functions-catalog](https://github.com/kptdev/krm-functions-catalog) `tests/` +directory to validate the functions running inside the containers against `kpt fn render`. + +--- + +Next: [Containerizing](containerizing.md) — packaging your function as a container image. diff --git a/docs/tutorial.md b/docs/tutorial.md new file mode 100644 index 000000000..ca2d151dc --- /dev/null +++ b/docs/tutorial.md @@ -0,0 +1,229 @@ +# Tutorial: Developing a KRM Function + +This tutorial walks through the end-to-end workflow for building a KRM function +using the Go SDK. By the end, you will have a working function with embedded +documentation, golden tests, and support for `--help`, `--doc`, and standalone +file mode. + +For a complete working example, see [`go/get-started/`](../go/get-started/). + +## 1. Create Your Function + +A KRM function implements the `fn.Runner` interface: + +```go +type Runner interface { + Run(context *Context, functionConfig *KubeObject, items KubeObjects, results *Results) bool +} +``` + +Here is a minimal function that sets labels on all the resources: + +```go +package main + +import ( + "context" + _ "embed" + "os" + + "github.com/kptdev/krm-functions-sdk/go/fn" +) + +//go:embed README.md +var readme []byte + +//go:embed metadata.yaml +var metadata []byte + +var _ fn.Runner = &SetLabels{} + +type SetLabels struct { + Labels map[string]string `json:"labels,omitempty"` +} + +func (r *SetLabels) Run(ctx *fn.Context, functionConfig *fn.KubeObject, items fn.KubeObjects, results *fn.Results) bool { + for _, obj := range items { + for k, v := range r.Labels { + if err := obj.SetLabel(k, v); err != nil { + results.ErrorE(err) + } + } + } + return results.ExitCode() == 0 +} + +func main() { + runner := fn.WithContext(context.Background(), &SetLabels{}) + if err := fn.AsMain(runner, fn.WithDocs(readme, metadata)); err != nil { + os.Exit(1) + } +} +``` + +Key points: +- Your struct fields are automatically populated from `functionConfig` (JSON unmarshaling). +- Return `true` for success, `false` for failure. +- Use `results` to report structured messages (info, warning, error). + +## 2. Embed Documentation with `//go:embed` + +The SDK uses Go's embed directive to bundle documentation into the binary. +Two files are needed: + +### README.md + +Use `` markers to define sections that `--help` and `--doc` extract: + + # set-labels + + + Set labels on all resources in the package. + + + + ## Usage + + The `set-labels` function adds or updates labels on all KRM resources. + It accepts a `SetLabels` functionConfig with a `labels` map. + + ### FunctionConfig + + ```yaml + apiVersion: fn.kpt.dev/v1alpha1 + kind: SetLabels + metadata: + name: my-config + labels: + app: my-app + env: production + ``` + + + + + + Set a single label on all resources: + + ```yaml + apiVersion: fn.kpt.dev/v1alpha1 + kind: SetLabels + labels: + team: platform + ``` + + + +### metadata.yaml + +```yaml +image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1 +description: Set labels on all resources +tags: + - mutator + - labels +sourceURL: https://github.com/kptdev/krm-functions/tree/main/functions/go/set-labels +examplePackageURLs: + - https://github.com/kptdev/krm-functions/tree/main/examples/set-labels-simple +license: Apache-2.0 +hidden: false +``` + +### Wire it up + +In your `main.go`: + +```go +//go:embed README.md +var readme []byte + +//go:embed metadata.yaml +var metadata []byte + +func main() { + runner := fn.WithContext(context.Background(), &SetLabels{}) + if err := fn.AsMain(runner, fn.WithDocs(readme, metadata)); err != nil { + os.Exit(1) + } +} +``` + +## 3. Running Your Function + +### Standard mode (STDIN/STDOUT) + +Pipe a ResourceList through your function: + +```bash +cat input.yaml | go run . > output.yaml +``` + +### Help mode + +View human-readable documentation: + +```bash +go run . --help +``` + +This prints the Short, Long, and Examples sections extracted from your README markers. + +### Doc mode + +Get machine-readable JSON documentation (consumed by `kpt fn doc` and catalog pipelines): + +```bash +go run . --doc +``` + +### File mode + +Process KRM files directly without constructing a ResourceList: + +```bash +go run . deployment.yaml service.yaml +``` + +This reads the YAML files, assembles them into a ResourceList with an empty +functionConfig, processes them, and writes the result to STDOUT. + +## 4. Testing with Golden Tests + +The SDK provides `testhelpers.RunGoldenTests` for snapshot-based testing. + +Create a test directory structure: + +``` +testdata/ +├── test-case-1/ +│ ├── _expected.yaml # Expected output (ResourceList YAML) +│ ├── _fnconfig.yaml # FunctionConfig for this test case +│ └── resources.yaml # Input resources +└── test-case-2/ + ├── _expected.yaml + ├── _fnconfig.yaml + └── resources.yaml +``` + +Write your test: + +```go +func TestFunction(t *testing.T) { + runner := fn.WithContext(context.TODO(), &SetLabels{}) + testhelpers.RunGoldenTests(t, "testdata", runner) +} +``` + +Update expected output after changes: + +```bash +WRITE_GOLDEN_OUTPUT=1 go test ./... +``` + +See [testing](testing.md) for more details. + +## 5. Next Steps + +- [Interfaces](interfaces.md) — when to use `fn.Runner` vs `fn.ResourceListProcessor` +- [Testing](testing.md) — golden test patterns in depth +- [Containerizing](containerizing.md) — packaging your function as a container image diff --git a/go/fn/examples/go.mod b/go/fn/examples/go.mod index 76e52b5a0..a169c10fc 100644 --- a/go/fn/examples/go.mod +++ b/go/fn/examples/go.mod @@ -2,18 +2,20 @@ module github.com/kptdev/krm-functions-sdk/go/fn/examples go 1.26.3 +// NOTE: replace directive is for in-repo development only. +// External consumers should use: require github.com/kptdev/krm-functions-sdk/go/fn v1.x.x replace github.com/kptdev/krm-functions-sdk/go/fn => ../ require ( - github.com/kptdev/krm-functions-sdk/go/fn v1.0.2 - k8s.io/api v0.36.1 + github.com/kptdev/krm-functions-sdk/go/fn v1.0.0 + k8s.io/api v0.34.1 k8s.io/apimachinery v0.36.1 sigs.k8s.io/kustomize/kyaml v0.21.1 ) require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/fxamacker/cbor/v2 v2.9.2 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/go-errors/errors v1.5.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-openapi/jsonpointer v0.23.1 // indirect @@ -30,6 +32,7 @@ require ( github.com/go-openapi/swag/stringutils v0.26.0 // indirect github.com/go-openapi/swag/typeutils v0.26.0 // indirect github.com/go-openapi/swag/yamlutils v0.26.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect github.com/google/gnostic-models v0.7.1 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kr/text v0.2.0 // indirect @@ -41,15 +44,15 @@ require ( github.com/xlab/treeprint v1.2.0 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/net v0.54.0 // indirect + golang.org/x/net v0.49.0 // indirect golang.org/x/sys v0.44.0 // indirect - golang.org/x/text v0.37.0 // indirect + golang.org/x/text v0.33.0 // indirect google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect gopkg.in/inf.v0 v0.9.1 // indirect k8s.io/klog/v2 v2.140.0 // indirect k8s.io/kube-openapi v0.0.0-20260520065146-aa012df4f4af // indirect - k8s.io/utils v0.0.0-20260507154919-ff6756f316d2 // indirect + k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/randfill v1.0.0 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.4.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect ) diff --git a/go/fn/examples/go.sum b/go/fn/examples/go.sum index 4e1a9f1ea..e9891fbdd 100644 --- a/go/fn/examples/go.sum +++ b/go/fn/examples/go.sum @@ -3,8 +3,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fxamacker/cbor/v2 v2.9.2 h1:X4Ksno9+x3cz0TZv69ec1hxP/+tymuR8PXQJyDwfh78= -github.com/fxamacker/cbor/v2 v2.9.2/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= @@ -43,6 +43,8 @@ github.com/go-openapi/testify/enable/yaml/v2 v2.4.2 h1:5zRca5jw7lzVREKCZVNBpysDN github.com/go-openapi/testify/enable/yaml/v2 v2.4.2/go.mod h1:XVevPw5hUXuV+5AkI1u1PeAm27EQVrhXTTCPAF85LmE= github.com/go-openapi/testify/v2 v2.4.2 h1:tiByHpvE9uHrrKjOszax7ZvKB7QOgizBWGBLuq0ePx4= github.com/go-openapi/testify/v2 v2.4.2/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= @@ -50,6 +52,8 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -82,16 +86,43 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= -golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= +golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -102,23 +133,25 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.36.1 h1:XbL/EMj8K2aJpJtePmqUyQMsM0D4QI2pvl7YKJ20FTY= -k8s.io/api v0.36.1/go.mod h1:KOWo4ey3TINlXjeHVuwB3i+tXXnu+UcwFBHlI/9dvEo= +k8s.io/api v0.34.1 h1:jC+153630BMdlFukegoEL8E/yT7aLyQkIVuwhmwDgJM= +k8s.io/api v0.34.1/go.mod h1:SB80FxFtXn5/gwzCoN6QCtPD7Vbu5w2n1S0J5gFfTYk= k8s.io/apimachinery v0.36.1 h1:G63Gjx2W+q0YD+72Vo8oY0nDnePVwnuzTmmy5ENrVSA= k8s.io/apimachinery v0.36.1/go.mod h1:ibYOR00vW/I1kzvi5SF0dRuJ52BvKtfvRdOn35GPQ+8= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= k8s.io/kube-openapi v0.0.0-20260520065146-aa012df4f4af h1:zLXA2Irn14q2/06WMkxViyr7YCPUO2lJ0QYE9Juy5vA= k8s.io/kube-openapi v0.0.0-20260520065146-aa012df4f4af/go.mod h1:V/QaCUYDa+0QpcHhVVc5l99Uz56wEMEXBSj9oCDkNDY= -k8s.io/utils v0.0.0-20260507154919-ff6756f316d2 h1:wU4tMEhLGgIbLvXQb1cfN+EcM0wf7zC6CPF+C79jroc= -k8s.io/utils v0.0.0-20260507154919-ff6756f316d2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 h1:AZYQSJemyQB5eRxqcPky+/7EdBj0xi3g0ZcxxJ7vbWU= +k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +pgregory.net/rapid v1.3.0 h1:vBvO0VSqti75J1jjYqpgPNBLKMd1+gxa9fYo7vk/Exc= +pgregory.net/rapid v1.3.0/go.mod h1:dPlE4OBBxgXPqkP79flB6sJL1dx5azpI7HQ9MY9Z7uk= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/kustomize/kyaml v0.21.1 h1:IVlbmhC076nf6foyL6Taw4BkrLuEsXUXNpsE+ScX7fI= sigs.k8s.io/kustomize/kyaml v0.21.1/go.mod h1:hmxADesM3yUN2vbA5z1/YTBnzLJ1dajdqpQonwBL1FQ= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= -sigs.k8s.io/structured-merge-diff/v6 v6.4.0 h1:qmp2e3ZfFi1/jJbDGpD4mt3wyp6PE1NfKHCYLqgNQJo= -sigs.k8s.io/structured-merge-diff/v6 v6.4.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/go/fn/internal/docs/metadata_test.go b/go/fn/internal/docs/metadata_test.go index 29c247816..d9d539c1c 100644 --- a/go/fn/internal/docs/metadata_test.go +++ b/go/fn/internal/docs/metadata_test.go @@ -51,7 +51,7 @@ func genMetadata() *rapid.Generator[Metadata] { // --- Unit Tests for ParseMetadata --- func TestParseMetadata_CompleteValid(t *testing.T) { - input := []byte(`image: gcr.io/kpt-fn/set-labels:v0.1 + input := []byte(`image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1 description: Set labels on all resources tags: - mutator @@ -68,8 +68,8 @@ hidden: false t.Fatalf("ParseMetadata returned unexpected error: %v", err) } - if m.Image != "gcr.io/kpt-fn/set-labels:v0.1" { - t.Errorf("Image = %q, want %q", m.Image, "gcr.io/kpt-fn/set-labels:v0.1") + if m.Image != "ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1" { + t.Errorf("Image = %q, want %q", m.Image, "ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1") } if m.Description != "Set labels on all resources" { t.Errorf("Description = %q, want %q", m.Description, "Set labels on all resources") @@ -101,7 +101,7 @@ func TestParseMetadata_InvalidYAML(t *testing.T) { input: []byte("tags:\n- valid\n bad: [unbalanced"), }, { - name: "invalid YAML with tabs in the wrong places", + name: "invalid YAML with tabs in wrong places", input: []byte(":\n\t- :\n\t\t- [[["), }, { @@ -132,10 +132,10 @@ func TestParseMetadata_PartialFields(t *testing.T) { }{ { name: "only image field", - input: []byte("image: gcr.io/kpt-fn/my-func:v1\n"), + input: []byte("image: ghcr.io/kptdev/krm-functions-catalog/my-func:v1\n"), validate: func(t *testing.T, m Metadata) { - if m.Image != "gcr.io/kpt-fn/my-func:v1" { - t.Errorf("Image = %q, want %q", m.Image, "gcr.io/kpt-fn/my-func:v1") + if m.Image != "ghcr.io/kptdev/krm-functions-catalog/my-func:v1" { + t.Errorf("Image = %q, want %q", m.Image, "ghcr.io/kptdev/krm-functions-catalog/my-func:v1") } if m.Description != "" { t.Errorf("Description = %q, want empty", m.Description) @@ -208,17 +208,17 @@ func TestParseMetadata_HiddenFieldPropagation(t *testing.T) { }{ { name: "hidden true", - input: []byte("image: gcr.io/kpt-fn/my-func:v1\nhidden: true\n"), + input: []byte("image: ghcr.io/kptdev/krm-functions-catalog/my-func:v1\nhidden: true\n"), hidden: true, }, { name: "hidden false explicit", - input: []byte("image: gcr.io/kpt-fn/my-func:v1\nhidden: false\n"), + input: []byte("image: ghcr.io/kptdev/krm-functions-catalog/my-func:v1\nhidden: false\n"), hidden: false, }, { name: "hidden absent defaults to false", - input: []byte("image: gcr.io/kpt-fn/my-func:v1\n"), + input: []byte("image: ghcr.io/kptdev/krm-functions-catalog/my-func:v1\n"), hidden: false, }, } diff --git a/go/fn/internal/docs/render.go b/go/fn/internal/docs/render.go index f7185facb..e6c17839b 100644 --- a/go/fn/internal/docs/render.go +++ b/go/fn/internal/docs/render.go @@ -77,7 +77,7 @@ func isMetadataEmpty(meta Metadata) bool { } // RenderDoc writes JSON-encoded DocOutput to w. -// Returns error only if JSON encoding fails (shouldn't happen with these types). +// Returns error only if JSON encoding fails (should not happen with these types). func RenderDoc(w io.Writer, sections Sections, meta Metadata) error { out := DocOutput{ Short: sections.Short, diff --git a/go/fn/internal/docs/render_test.go b/go/fn/internal/docs/render_test.go index 6c23f47f6..12143dc73 100644 --- a/go/fn/internal/docs/render_test.go +++ b/go/fn/internal/docs/render_test.go @@ -241,10 +241,10 @@ func TestRenderHelp_FullSectionsAndMetadata(t *testing.T) { sections := Sections{ Short: "Set labels on all resources", Long: "The set-labels function adds or updates labels on all resources in the package.", - Examples: " kpt fn eval --image gcr.io/kpt-fn/set-labels:v0.1 -- label_name=label_value", + Examples: " kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1 -- label_name=label_value", } meta := Metadata{ - Image: "gcr.io/kpt-fn/set-labels:v0.1", + Image: "ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1", Description: "Set labels on all resources", Tags: []string{"mutator", "labels"}, } @@ -296,10 +296,10 @@ func TestRenderDoc_ValidJSON_AllFields(t *testing.T) { sections := Sections{ Short: "Set labels on all resources", Long: "The set-labels function adds or updates labels.", - Examples: " kpt fn eval --image gcr.io/kpt-fn/set-labels:v0.1", + Examples: " kpt fn eval --image ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1", } meta := Metadata{ - Image: "gcr.io/kpt-fn/set-labels:v0.1", + Image: "ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1", Description: "Set labels on all resources", Tags: []string{"mutator", "labels"}, SourceURL: "https://github.com/kptdev/krm-functions/tree/main/functions/go/set-labels", diff --git a/go/fn/run_flags_test.go b/go/fn/run_flags_test.go index d07f3ec6f..578fc1763 100644 --- a/go/fn/run_flags_test.go +++ b/go/fn/run_flags_test.go @@ -91,7 +91,7 @@ func setArgs(t *testing.T, args []string) { func TestAsMain_HelpFlag_ExitsZero(t *testing.T) { setArgs(t, []string{"cmd", "--help"}) - // Close stdin to prove it's not read — if AsMain tries to read STDIN, + // Close stdin to prove it is not read — if AsMain tries to read STDIN, // it would get an error or EOF immediately. origStdin := os.Stdin r, w, err := os.Pipe() @@ -145,7 +145,7 @@ The set-labels function adds labels to all resources. kpt fn eval --image set-labels:v0.1 `) - meta := []byte(`image: gcr.io/kpt-fn/set-labels:v0.1 + meta := []byte(`image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1 description: Set labels on all resources `) @@ -173,7 +173,7 @@ Set labels Long description here. `) - meta := []byte(`image: gcr.io/kpt-fn/set-labels:v0.1 + meta := []byte(`image: ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1 description: Set labels on all resources tags: - mutator @@ -193,7 +193,7 @@ license: Apache-2.0 // Verify fields are populated assert.Equal(t, "Set labels", docOutput.Short) assert.Equal(t, "Long description here.", docOutput.Long) - assert.Equal(t, "gcr.io/kpt-fn/set-labels:v0.1", docOutput.Image) + assert.Equal(t, "ghcr.io/kptdev/krm-functions-catalog/set-labels:v0.1", docOutput.Image) assert.Equal(t, "Set labels on all resources", docOutput.Description) assert.Equal(t, []string{"mutator"}, docOutput.Tags) assert.Equal(t, "Apache-2.0", docOutput.License) @@ -222,7 +222,7 @@ func TestAsMain_DocFlag_HiddenField(t *testing.T) { Hidden function `) - meta := []byte(`image: gcr.io/kpt-fn/hidden-fn:v0.1 + meta := []byte(`image: ghcr.io/kptdev/krm-functions-catalog/hidden-fn:v0.1 description: A hidden function hidden: true `) @@ -237,7 +237,7 @@ hidden: true require.NoError(t, err, "--doc output should be valid JSON") assert.True(t, docOutput.Hidden, "hidden:true should propagate to JSON output") - assert.Equal(t, "gcr.io/kpt-fn/hidden-fn:v0.1", docOutput.Image) + assert.Equal(t, "ghcr.io/kptdev/krm-functions-catalog/hidden-fn:v0.1", docOutput.Image) } // TestAsMain_DocFlag_InvalidMetadataYAML verifies that invalid metadata YAML diff --git a/go/get-started/go.mod b/go/get-started/go.mod index 8110e34a2..2ce889141 100644 --- a/go/get-started/go.mod +++ b/go/get-started/go.mod @@ -2,9 +2,11 @@ module github.com/kptdev/krm-functions-sdk/go/get-started go 1.26.3 +// NOTE: replace directive is for in-repo development only. +// External consumers should use: require github.com/kptdev/krm-functions-sdk/go/fn v1.x.x replace github.com/kptdev/krm-functions-sdk/go/fn => ../fn -require github.com/kptdev/krm-functions-sdk/go/fn v1.0.2 +require github.com/kptdev/krm-functions-sdk/go/fn v1.0.0 require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect diff --git a/go/get-started/go.sum b/go/get-started/go.sum index 8ed5c62b9..9389024f6 100644 --- a/go/get-started/go.sum +++ b/go/get-started/go.sum @@ -77,6 +77,8 @@ k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= k8s.io/kube-openapi v0.0.0-20260520065146-aa012df4f4af h1:zLXA2Irn14q2/06WMkxViyr7YCPUO2lJ0QYE9Juy5vA= k8s.io/kube-openapi v0.0.0-20260520065146-aa012df4f4af/go.mod h1:V/QaCUYDa+0QpcHhVVc5l99Uz56wEMEXBSj9oCDkNDY= +pgregory.net/rapid v1.3.0 h1:vBvO0VSqti75J1jjYqpgPNBLKMd1+gxa9fYo7vk/Exc= +pgregory.net/rapid v1.3.0/go.mod h1:dPlE4OBBxgXPqkP79flB6sJL1dx5azpI7HQ9MY9Z7uk= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/kustomize/kyaml v0.21.1 h1:IVlbmhC076nf6foyL6Taw4BkrLuEsXUXNpsE+ScX7fI= diff --git a/go/get-started/main.go b/go/get-started/main.go index b772ec875..9efdc9f58 100644 --- a/go/get-started/main.go +++ b/go/get-started/main.go @@ -1,4 +1,4 @@ -// Copyright 2022 The kpt Authors +// Copyright 2022, 2026 The kpt Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,11 +16,18 @@ package main import ( "context" + _ "embed" "os" "github.com/kptdev/krm-functions-sdk/go/fn" ) +//go:embed README.md +var readme []byte + +//go:embed metadata.yaml +var metadata []byte + var _ fn.Runner = &YourFunction{} // TODO: Change to your functionConfig "Kind" name. @@ -41,7 +48,7 @@ func (r *YourFunction) Run(ctx *fn.Context, functionConfig *fn.KubeObject, items func main() { runner := fn.WithContext(context.Background(), &YourFunction{}) - if err := fn.AsMain(runner); err != nil { + if err := fn.AsMain(runner, fn.WithDocs(readme, metadata)); err != nil { os.Exit(1) } } diff --git a/go/get-started/metadata.yaml b/go/get-started/metadata.yaml new file mode 100644 index 000000000..ce0f22645 --- /dev/null +++ b/go/get-started/metadata.yaml @@ -0,0 +1,8 @@ +image: ghcr.io/kptdev/krm-functions-catalog/some-function-name:v0.1 +description: Explain what this function does in one or two sentences. +tags: + - mutator +sourceURL: https://github.com/kptdev/krm-functions-sdk/tree/main/go/get-started +examplePackageURLs: [] +license: Apache-2.0 +hidden: false diff --git a/go/get-started/testdata/test1/_expected.yaml b/go/get-started/testdata/noop-passthrough/_expected.yaml similarity index 100% rename from go/get-started/testdata/test1/_expected.yaml rename to go/get-started/testdata/noop-passthrough/_expected.yaml diff --git a/go/get-started/testdata/test1/_fnconfig.yaml b/go/get-started/testdata/noop-passthrough/_fnconfig.yaml similarity index 100% rename from go/get-started/testdata/test1/_fnconfig.yaml rename to go/get-started/testdata/noop-passthrough/_fnconfig.yaml diff --git a/go/get-started/testdata/test1/resources.yaml b/go/get-started/testdata/noop-passthrough/resources.yaml similarity index 100% rename from go/get-started/testdata/test1/resources.yaml rename to go/get-started/testdata/noop-passthrough/resources.yaml