{"modulePath":"github.com/devopsext/tools","version":"v0.21.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package render\n\n## Constants\n\n```go\nconst (\n\tDefaultTimeout = 5 * time.Second\n\tErrorCodeParam = -1\n\tErrorCodeTLS   = -2\n\tErrorCodeHTTP  = -3\n)\n```\n\n## Types\n\n```go\ntype HTTPResult struct {\n\tBody       []byte\n\tError      string\n\tStatusCode int\n}\n```\n\n```go\ntype HtmlTemplate struct {\n\tTemplate\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewHtmlTemplate(options TemplateOptions, logger common.Logger) (*HtmlTemplate, error)\n```\n\n```go\nfunc (tpl *HtmlTemplate) CustomRenderWithOptions(opts TemplateOptions) ([]byte, error)\n```\n\n```go\nfunc (tpl *HtmlTemplate) Render() ([]byte, error)\n```\n\n```go\nfunc (tpl *HtmlTemplate) RenderObject(obj interface{}) ([]byte, error)\n```\n\n```go\ntype ReadFileResult struct {\n\tContent []byte\n\tError   string\n}\n```\n\n```go\ntype Template struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (tpl *Template) AWSS3GetObject(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) AWSS3ListObjects(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) AWSS3PutObject(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) AppendString(arr []string, items ...string) []string\n```\n\n```go\nfunc (tpl *Template) CatchpointInstantTest(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) Compare(v1, v2 interface{}) bool\n```\n\n```go\nfunc (tpl *Template) Content(s string) (string, error)\n```\n\n```go\nfunc (tpl *Template) CountOccurrences(list []interface{}) map[string]int\n```\n\n```go\nfunc (tpl *Template) DateParse(d string) (time.Time, error)\n```\n\n```go\nfunc (tpl *Template) DirCreate(path string, mode int) error\n```\n\n```go\nfunc (tpl *Template) DirRemove(path string, recursive bool) error\n```\n\n```go\nfunc (tpl *Template) Duration(start time.Time) string\n```\nDuration calculates the duration from start time to now and returns a formatted string Example: \"1.234s\", \"500ms\", \"2.5s\"\n\n```go\nfunc (tpl *Template) DurationBetween(start, end time.Time) map[string]int\n```\n\n```go\nfunc (tpl *Template) DurationString(start, end time.Time) string\n```\nDurationString converts two time.Time values to a duration string Example: \"1.234s\", \"500ms\", \"2.5s\"\n\n```go\nfunc (tpl *Template) Env(key string) (string, error)\n```\n\n```go\nfunc (tpl *Template) Error(format string, a ...any) error\n```\n\n```go\nfunc (tpl *Template) EscapeString(s string) (string, error)\n```\n\n```go\nfunc (tpl *Template) Exec(path string, timeout int, params []string) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) FileCreate(path, content string, mode int) error\n```\n\n```go\nfunc (tpl *Template) FindKey(obj interface{}, field string, value interface{}) interface{}\n```\n\n```go\nfunc (tpl *Template) FindKeys(obj interface{}, field string, value interface{}) []interface{}\n```\n\n```go\nfunc (tpl *Template) FindObject(obj interface{}, field string, value interface{}) interface{}\n```\n\n```go\nfunc (tpl *Template) FindObjects(obj interface{}, field string, value interface{}) []interface{}\n```\n\n```go\nfunc (tpl *Template) FloatList(items ...float64) []float64\n```\n\n```go\nfunc (tpl *Template) FromJson(i interface{}) (interface{}, error)\n```\n\n```go\nfunc (tpl *Template) FromYaml(i interface{}) (interface{}, error)\n```\n\n```go\nfunc (tpl *Template) GitlabPipelineVars(URL string, token string, projectID int, query string, limit int) string\n```\n\n```go\nfunc (tpl *Template) Gjson(obj interface{}, path string) (string, error)\n```\n\n```go\nfunc (tpl *Template) GoogleCalendarDeleteEvents(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) GoogleCalendarGetEvents(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) GoogleCalendarInsertEvent(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) GoogleDocsCopyDocument(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) GoogleMeetCreateSpace(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) GrafanaCopyDashboard(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) GrafanaCreateDashboard(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) HttpForm(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) HttpGet(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) HttpGetExt(params map[string]interface{}) HTTPResult\n```\n\n```go\nfunc (tpl *Template) HttpGetHeader(params map[string]interface{}) ([]byte, error)\n```\nurl, contentType, authorization string, timeout int\n\n```go\nfunc (tpl *Template) HttpGetSilent(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) HttpPatch(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) HttpPost(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) HttpPostExt(params map[string]interface{}) HTTPResult\n```\n\n```go\nfunc (tpl *Template) HttpPut(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) IfDef(i interface{}, def string) (string, error)\n```\n\n```go\nfunc (tpl *Template) IfElse(o interface{}, vars []interface{}) interface{}\n```\n\n```go\nfunc (tpl *Template) IfError(flag interface{}, format string, a ...any) (string, error)\n```\n\n```go\nfunc (tpl *Template) IfIP(obj interface{}) bool\n```\n\n```go\nfunc (tpl *Template) IfIPAndPort(obj interface{}) bool\n```\n\n```go\nfunc (tpl *Template) IntList(items ...int64) []int64\n```\n\n```go\nfunc (tpl *Template) IsEmpty(v interface{}) (bool, error)\n```\n\n```go\nfunc (tpl *Template) IsNotEmpty(v interface{}) (bool, error)\n```\n\n```go\nfunc (tpl *Template) JiraAddComment(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraCreateAsset(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraCreateIssue(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraGetIssueTransition(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraGetUserByEmail(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraIssueTransition(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraMoveIssue(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraSearchAssets(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraSearchIssue(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraUpdateAsset(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) JiraUpdateIssue(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) Join(sep string, a []string) (string, error)\n```\njoin is a version of strings.Join that can be piped\n\n```go\nfunc (tpl *Template) JsonEscape(s string) (string, error)\n```\n\n```go\nfunc (tpl *Template) Jsonata(data interface{}, query string) (string, error)\n```\n\n```go\nfunc (tpl *Template) K8sResourceDelete(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) K8sResourceDescribe(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) K8sResourceRestart(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) K8sResourceScale(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) LdapGetGroupMembers(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) ListFilesWithModTime(rootDir string) (map[string]string, error)\n```\n\n```go\nfunc (tpl *Template) LogDebug(obj interface{}, args ...interface{}) (string, error)\n```\nput warnings to logger\n\n```go\nfunc (tpl *Template) LogError(obj interface{}, args ...interface{}) (string, error)\n```\nput errors to logger\n\n```go\nfunc (tpl *Template) LogInfo(obj interface{}, args ...interface{}) (string, error)\n```\nput information to logger\n\n```go\nfunc (tpl *Template) LogWarn(obj interface{}, args ...interface{}) (string, error)\n```\nput warnings to logger\n\n```go\nfunc (tpl *Template) NowFmt(f string) string\n```\n\n```go\nfunc (tpl *Template) PagerDutyCreateIncident(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) PagerDutySendNoteToIncident(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) ParserLine() (int, error)\n```\n\n```go\nfunc (tpl *Template) PrometheusGet(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) ReadFile(params map[string]any) ReadFileResult\n```\n\n```go\nfunc (tpl *Template) RegexFindSubmatch(regex string, s string) []string\n```\n\n```go\nfunc (tpl *Template) RegexMatch(re, s string) (bool, error)\n```\nregexMatch returns true or alse if the string matches the given regular expression\n\n```go\nfunc (tpl *Template) RegexMatchFindKey(obj interface{}, field, value string) interface{}\n```\n\n```go\nfunc (tpl *Template) RegexMatchFindKeys(obj interface{}, field, value string) []interface{}\n```\n\n```go\nfunc (tpl *Template) RegexMatchObjectByField(obj interface{}, field, value string) interface{}\n```\n\n```go\nfunc (tpl *Template) RegexReplaceAll(re, pl, s string) (string, error)\n```\nregexReplaceAll replaces all occurrences of a regular expression with the given replacement value.\n\n```go\nfunc (tpl *Template) ReplaceAll(f, t, s string) (string, error)\n```\nreplaceAll replaces all occurrences of a value in a string with the given replacement value.\n\n```go\nfunc (tpl *Template) SSHRun(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) Sleep(ms int) string\n```\n\n```go\nfunc (tpl *Template) SortOccurrences(occurrences map[string]int, sep string, count int) []string\n```\n\n```go\nfunc (tpl *Template) Split(sep, s string) ([]string, error)\n```\nsplit is a version of strings.Split that can be piped\n\n```go\nfunc (tpl *Template) StringList(items ...string) []string\n```\n\n```go\nfunc (tpl *Template) TagExists(s, key string) (bool, error)\n```\n\n```go\nfunc (tpl *Template) TagValue(s, key string) (string, error)\n```\n\n```go\nfunc (tpl *Template) TemplateRender(name string, obj interface{}) (string, error)\n```\n\n```go\nfunc (tpl *Template) TemplateRenderFile(path string, obj interface{}) (string, error)\n```\n\n```go\nfunc (tpl *Template) TimeFormat(s string, format string) (string, error)\n```\n\n```go\nfunc (tpl *Template) TimeNano(s string) (string, error)\n```\n\n```go\nfunc (tpl *Template) ToJson(i interface{}) (string, error)\n```\ntoJSON converts the given structure into a deeply nested JSON string.\n\n```go\nfunc (tpl *Template) ToLower(s string) (string, error)\n```\ntoLower converts the given string (usually by a pipe) to lowercase.\n\n```go\nfunc (tpl *Template) ToString(i interface{}) (string, error)\n```\ntoString converts the given value to string\n\n```go\nfunc (tpl *Template) ToTitle(s string) (string, error)\n```\ntoTitle converts the given string (usually by a pipe) to titlecase.\n\n```go\nfunc (tpl *Template) ToUpper(s string) (string, error)\n```\ntoUpper converts the given string (usually by a pipe) to uppercase.\n\n```go\nfunc (tpl *Template) ToYaml(i interface{}) (string, error)\n```\ntoYaml converts the given structure into a deeply nested Yaml string.\n\n```go\nfunc (tpl *Template) TryFromJson(i interface{}) interface{}\n```\n\n```go\nfunc (tpl *Template) TryHttpPost(params map[string]interface{}) []byte\n```\n\n```go\nfunc (tpl *Template) URLWait(url string, timeout, retry int, size int64) []byte\n```\n\n```go\nfunc (tpl *Template) UUID() string\n```\n\n```go\nfunc (tpl *Template) UnescapeString(s string) (string, error)\n```\n\n```go\nfunc (tpl *Template) VMReboot(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) VMReset(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) VMShutdown(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) VMStart(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) VMStatus(params map[string]interface{}) ([]byte, error)\n```\n\n```go\nfunc (tpl *Template) VMStop(params map[string]interface{}) ([]byte, error)\n```\n\n```go\ntype TemplateOptions struct {\n\tName        string\n\tObject      string\n\tContent     string\n\tFiles       []string\n\tTimeFormat  string\n\tPattern     string\n\tFuncs       map[string]any\n\tFilterFuncs bool\n}\n```\n\n```go\ntype TextTemplate struct {\n\tTemplate\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewTextTemplate(options TemplateOptions, logger common.Logger) (*TextTemplate, error)\n```\n\n```go\nfunc (tpl *TextTemplate) CustomRenderWithOptions(opts TemplateOptions) ([]byte, error)\n```\n\n```go\nfunc (tpl *TextTemplate) Render() ([]byte, error)\n```\n\n```go\nfunc (tpl *TextTemplate) RenderObject(obj interface{}) ([]byte, error)\n```\n\n","path":"github.com/devopsext/tools/render","name":"render","synopsis":"","isRedistributable":true}
