Documentation ¶
Index ¶
- Constants
- Variables
- func AddHeaders(req *http.Request, headers map[string]string)
- func GetCertificateInfo(w http.ResponseWriter, r *http.Request)
- func GetJsonParamsBody(params map[string]string) (io.Reader, error)
- func GetUrlValues(params map[string]string) url.Values
- func PerformRequest(requestConfig RequestConfig, throttle chan int) error
- func RequestsInit(data []RequestConfig, concurrency int)
- func StartMonitoring()
- type RequestConfig
Constants ¶
View Source
const ( ContentType = "Content-Type" ContentLength = "Content-Length" FormContentType = "application/x-www-form-urlencoded" JsonContentType = "application/json" DefaultTime = "300s" DefaultResponseCode = http.StatusOK DefaultConcurrency = 1 AuthenticationRequired = http.StatusNetworkAuthenticationRequired )
Variables ¶
View Source
var (
RequestsList []RequestConfig
)
Functions ¶
func AddHeaders ¶
Add header values from map to request
func GetCertificateInfo ¶
func GetCertificateInfo(w http.ResponseWriter, r *http.Request)
func GetJsonParamsBody ¶
Creates body for request of type application/json from map
func GetUrlValues ¶
convert params in map to url.Values
func PerformRequest ¶
func PerformRequest(requestConfig RequestConfig, throttle chan int) error
Uses date from request Config and creates and executes http request
func RequestsInit ¶
func RequestsInit(data []RequestConfig, concurrency int)
Initialize data from config file and check all requests
func StartMonitoring ¶
func StartMonitoring()
Start monitoring by calling createTicker method for each request
Types ¶
type RequestConfig ¶
type RequestConfig struct { Id int Url string `json:"url"` Environment string `json:"environment"` Priority string `json:"priority"` RequestType string `json:"requestType"` Headers map[string]string `json:"headers"` FormParams map[string]string `json:"formParams"` UrlParams map[string]string `json:"urlParams"` Tags []string `json:"tags"` Details map[string]string `json:"details"` ResponseCode int `json:"responseCode"` ResponseTime int64 `json:"responseTime"` ResponseBody string `json:"responseBody"` CheckEvery time.Duration `json:"checkEvery"` }
func (*RequestConfig) Validate ¶
func (requestConfig *RequestConfig) Validate() error
Check all request Config fields are valid
Click to show internal directories.
Click to hide internal directories.