Documentation
¶
Index ¶
- Constants
- type HTTPResult
- type HtmlTemplate
- type ReadFileResult
- type Template
- func (tpl *Template) AWSS3GetObject(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) AWSS3ListObjects(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) AWSS3PutObject(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) AppendString(arr []string, items ...string) []string
- func (tpl *Template) CatchpointInstantTest(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) Compare(v1, v2 interface{}) bool
- func (tpl *Template) Content(s string) (string, error)
- func (tpl *Template) CountOccurrences(list []interface{}) map[string]int
- func (tpl *Template) DateParse(d string) (time.Time, error)
- func (tpl *Template) DirCreate(path string, mode int) error
- func (tpl *Template) DirRemove(path string, recursive bool) error
- func (tpl *Template) Duration(start time.Time) string
- func (tpl *Template) DurationBetween(start, end time.Time) map[string]int
- func (tpl *Template) DurationString(start, end time.Time) string
- func (tpl *Template) Env(key string) (string, error)
- func (tpl *Template) Error(format string, a ...any) error
- func (tpl *Template) EscapeString(s string) (string, error)
- func (tpl *Template) Exec(path string, timeout int, params []string) ([]byte, error)
- func (tpl *Template) FileCreate(path, content string, mode int) error
- func (tpl *Template) FindKey(obj interface{}, field string, value interface{}) interface{}
- func (tpl *Template) FindKeys(obj interface{}, field string, value interface{}) []interface{}
- func (tpl *Template) FindObject(obj interface{}, field string, value interface{}) interface{}
- func (tpl *Template) FindObjects(obj interface{}, field string, value interface{}) []interface{}
- func (tpl *Template) FloatList(items ...float64) []float64
- func (tpl *Template) FromJson(i interface{}) (interface{}, error)
- func (tpl *Template) FromYaml(i interface{}) (interface{}, error)
- func (tpl *Template) GitlabPipelineVars(URL string, token string, projectID int, query string, limit int) string
- func (tpl *Template) Gjson(obj interface{}, path string) (string, error)
- func (tpl *Template) GoogleCalendarDeleteEvents(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) GoogleCalendarGetEvents(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) GoogleCalendarInsertEvent(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) GoogleDocsCopyDocument(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) GoogleMeetCreateSpace(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) GrafanaCopyDashboard(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) GrafanaCreateDashboard(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) HttpForm(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) HttpGet(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) HttpGetExt(params map[string]interface{}) HTTPResult
- func (tpl *Template) HttpGetHeader(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) HttpGetSilent(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) HttpPatch(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) HttpPost(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) HttpPostExt(params map[string]interface{}) HTTPResult
- func (tpl *Template) HttpPut(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) IfDef(i interface{}, def string) (string, error)
- func (tpl *Template) IfElse(o interface{}, vars []interface{}) interface{}
- func (tpl *Template) IfError(flag interface{}, format string, a ...any) (string, error)
- func (tpl *Template) IfIP(obj interface{}) bool
- func (tpl *Template) IfIPAndPort(obj interface{}) bool
- func (tpl *Template) IntList(items ...int64) []int64
- func (tpl *Template) IsEmpty(v interface{}) (bool, error)
- func (tpl *Template) IsNotEmpty(v interface{}) (bool, error)
- func (tpl *Template) JiraAddComment(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraCreateAsset(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraCreateIssue(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraGetIssueTransition(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraGetUserByEmail(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraIssueTransition(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraMoveIssue(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraSearchAssets(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraSearchIssue(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraUpdateAsset(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) JiraUpdateIssue(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) Join(sep string, a []string) (string, error)
- func (tpl *Template) JsonEscape(s string) (string, error)
- func (tpl *Template) Jsonata(data interface{}, query string) (string, error)
- func (tpl *Template) K8sResourceDelete(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) K8sResourceDescribe(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) K8sResourceRestart(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) K8sResourceScale(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) LdapGetGroupMembers(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) ListFilesWithModTime(rootDir string) (map[string]string, error)
- func (tpl *Template) LogDebug(obj interface{}, args ...interface{}) (string, error)
- func (tpl *Template) LogError(obj interface{}, args ...interface{}) (string, error)
- func (tpl *Template) LogInfo(obj interface{}, args ...interface{}) (string, error)
- func (tpl *Template) LogWarn(obj interface{}, args ...interface{}) (string, error)
- func (tpl *Template) NowFmt(f string) string
- func (tpl *Template) PagerDutyCreateIncident(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) PagerDutySendNoteToIncident(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) ParserLine() (int, error)
- func (tpl *Template) PrometheusGet(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) ReadFile(params map[string]any) ReadFileResult
- func (tpl *Template) RegexFindSubmatch(regex string, s string) []string
- func (tpl *Template) RegexMatch(re, s string) (bool, error)
- func (tpl *Template) RegexMatchFindKey(obj interface{}, field, value string) interface{}
- func (tpl *Template) RegexMatchFindKeys(obj interface{}, field, value string) []interface{}
- func (tpl *Template) RegexMatchObjectByField(obj interface{}, field, value string) interface{}
- func (tpl *Template) RegexReplaceAll(re, pl, s string) (string, error)
- func (tpl *Template) ReplaceAll(f, t, s string) (string, error)
- func (tpl *Template) SSHRun(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) Sleep(ms int) string
- func (tpl *Template) SortOccurrences(occurrences map[string]int, sep string, count int) []string
- func (tpl *Template) Split(sep, s string) ([]string, error)
- func (tpl *Template) StringList(items ...string) []string
- func (tpl *Template) TagExists(s, key string) (bool, error)
- func (tpl *Template) TagValue(s, key string) (string, error)
- func (tpl *Template) TemplateRender(name string, obj interface{}) (string, error)
- func (tpl *Template) TemplateRenderFile(path string, obj interface{}) (string, error)
- func (tpl *Template) TimeFormat(s string, format string) (string, error)
- func (tpl *Template) TimeNano(s string) (string, error)
- func (tpl *Template) ToJson(i interface{}) (string, error)
- func (tpl *Template) ToLower(s string) (string, error)
- func (tpl *Template) ToString(i interface{}) (string, error)
- func (tpl *Template) ToTitle(s string) (string, error)
- func (tpl *Template) ToUpper(s string) (string, error)
- func (tpl *Template) ToYaml(i interface{}) (string, error)
- func (tpl *Template) TryFromJson(i interface{}) interface{}
- func (tpl *Template) TryHttpPost(params map[string]interface{}) []byte
- func (tpl *Template) URLWait(url string, timeout, retry int, size int64) []byte
- func (tpl *Template) UUID() string
- func (tpl *Template) UnescapeString(s string) (string, error)
- func (tpl *Template) VMReboot(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) VMReset(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) VMShutdown(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) VMStart(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) VMStatus(params map[string]interface{}) ([]byte, error)
- func (tpl *Template) VMStop(params map[string]interface{}) ([]byte, error)
- type TemplateOptions
- type TextTemplate
Constants ¶
View Source
const ( DefaultTimeout = 5 * time.Second ErrorCodeParam = -1 ErrorCodeTLS = -2 ErrorCodeHTTP = -3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPResult ¶ added in v0.17.1
type HtmlTemplate ¶
type HtmlTemplate struct {
Template
// contains filtered or unexported fields
}
func NewHtmlTemplate ¶
func NewHtmlTemplate(options TemplateOptions, logger common.Logger) (*HtmlTemplate, error)
func (*HtmlTemplate) CustomRenderWithOptions ¶ added in v0.4.5
func (tpl *HtmlTemplate) CustomRenderWithOptions(opts TemplateOptions) ([]byte, error)
func (*HtmlTemplate) Render ¶ added in v0.4.5
func (tpl *HtmlTemplate) Render() ([]byte, error)
func (*HtmlTemplate) RenderObject ¶ added in v0.4.6
func (tpl *HtmlTemplate) RenderObject(obj interface{}) ([]byte, error)
type ReadFileResult ¶ added in v0.20.4
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func (*Template) AWSS3GetObject ¶ added in v0.20.18
func (*Template) AWSS3ListObjects ¶ added in v0.20.18
func (*Template) AWSS3PutObject ¶ added in v0.20.18
func (*Template) AppendString ¶ added in v0.17.10
func (*Template) CatchpointInstantTest ¶ added in v0.15.17
func (*Template) CountOccurrences ¶ added in v0.15.10
func (*Template) Duration ¶ added in v0.20.5
Duration calculates the duration from start time to now and returns a formatted string Example: "1.234s", "500ms", "2.5s"
func (*Template) DurationBetween ¶ added in v0.15.11
func (*Template) DurationString ¶ added in v0.20.5
DurationString converts two time.Time values to a duration string Example: "1.234s", "500ms", "2.5s"