util

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAlertStatus added in v1.9.1

func GetAlertStatus(status string) string

render the alert status before sending alert message

func GetCurrentTime

func GetCurrentTime() int64

GetCurrentTime returns current timestamp

func ParseTemplate

func ParseTemplate(name string, template string, variables map[string]string) (string, error)

ParseString is used to get body according to template

func Request

func Request(options Option) ([]byte, error)

Request is used to do a post request

Types

type Option

type Option struct {
	Protocol string            `json:"protocol"`
	Host     string            `json:"host"`
	Path     string            `json:"path"`
	Method   string            `json:"method"`
	Headers  map[string]string `json:"headers"`
	Body     interface{}       `json:"body"`
}

Option is used to post request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL