{"modulePath":"github.com/linuxsuren/api-testing","version":"v0.0.21","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package render\n\nPackage render provides a simple way to render as template\n\nCopyright 2024 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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 24 permissions and limitations under the License.\n\nCopyright 2024 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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 24 permissions and limitations under the License.\n\nCopyright 2024 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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 24 permissions and limitations under the License.\n\nCopyright 2023 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2023-2025 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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 24 permissions and limitations under the License.\n\nCopyright 2025 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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 24 permissions and limitations under the License.\n\nCopyright 2024 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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 24 permissions and limitations under the License.\n\n## Functions\n\n```go\nfunc FuncMap() template.FuncMap\n```\nFuncMap returns all the supported functions\n\n```go\nfunc FuncUsage(funcName string) (usage string)\n```\nFuncUsage returns the usage of target template function\n\n```go\nfunc GetEngineVersion() (ver string)\n```\n\n```go\nfunc Render(name, text string, ctx interface{}) (result string, err error)\n```\nRender render then return the result\n\n```go\nfunc RenderAsBytes(name, text string, ctx interface{}) (data []byte, err error)\n```\n\n```go\nfunc RenderAsReader(name, text string, ctx interface{}) (reader io.Reader, err error)\n```\n\n```go\nfunc RenderThenPrint(name, text string, ctx interface{}, w io.Writer) (err error)\n```\nRenderThenPrint renders the template then prints the result\n\n```go\nfunc SetSecretGetter(getter secret.SecretGetter)\n```\nSetSecretGetter set the secret getter\n\n## Types\n\n```go\ntype AdvancedFunc struct {\n\tFuncName   string\n\tFunc       interface{}\n\tGoDogExper string\n\tGenerator  func(ctx context.Context, fields string) (err error)\n}\n```\nAdvancedFunc represents an advanced function\n\n```go\nfunc GetAdvancedFuncs() []AdvancedFunc\n```\nGetAdvancedFuncs returns all the advanced functions\n\n```go\ntype ContextKey string\n```\n\n```go\nvar ContextBufferKey ContextKey = \"ContextBufferKey\"\n```\n\n```go\ntype UserDefinedTemplate struct {\n\tName   string\n\tRender string\n}\n```\n\n```go\ntype UserDefinedTemplates struct {\n\tItems []UserDefinedTemplate\n}\n```\n\n```go\nfunc ParseUserDefinedTemplates(data []byte) (templates *UserDefinedTemplates, err error)\n```\n\n```go\nfunc ParseUserDefinedTemplatesFromFile(filePath string) (templates *UserDefinedTemplates, err error)\n```\n\n```go\nfunc (t *UserDefinedTemplates) ConflictWith(funcMap template.FuncMap) (conflict error)\n```\n\n```go\nfunc (t *UserDefinedTemplates) Validate() (err error)\n```\n\n```go\ntype WeightEnum struct {\n\tWeight int\n\tObject interface{}\n}\n```\nWeightEnum is a weight enum\n\n","path":"github.com/linuxsuren/api-testing/pkg/render","name":"render","synopsis":"Package render provides a simple way to render as template","isRedistributable":true}
