Documentation ¶
Index ¶
- Constants
- Variables
- func ReleaseHttpRequest(hr *HttpRequest)
- func ReleaseHttpResponse(hr *HttpResponse)
- type AlertBody
- func (ab *AlertBody) JsonBody() (string, error)
- func (ab *AlertBody) MarkdownContent()
- func (ab *AlertBody) Normalize()
- func (ab *AlertBody) PostParam() (string, error)
- func (ab *AlertBody) Record2File()
- func (ab *AlertBody) SendSelfExternel() (string, error)
- func (ab *AlertBody) SendSelfInternal() (string, error)
- func (ab *AlertBody) UrlParam() (string, error)
- type BodyTransform
- type HttpRequest
- type HttpResponse
- type MonitorResult
- type SingSmSResp
- type SingleSmsReq
- type Version
Constants ¶
View Source
const ( EXTERNALHOSTADDR = "https://alert.wxjwlsh.com:9000" //EXTERNALHOSTADDR = "http://192.168.1.170:8080" INTERNALHOSTADDR = "http://sealalert.seal.svc.cluster.local:8080" )
Variables ¶
View Source
var HttpRequestPool sync.Pool
View Source
var HttpResponsePool sync.Pool
Functions ¶
func ReleaseHttpRequest ¶
func ReleaseHttpRequest(hr *HttpRequest)
func ReleaseHttpResponse ¶
func ReleaseHttpResponse(hr *HttpResponse)
Types ¶
type AlertBody ¶
type AlertBody struct { UniqId string `json:"uniq_id" faker:"-"` Title string `json:"title" faker:"username"` Content string `json:"content" faker:"email"` Mobiles []string `json:"mobiles" faker:"chinesePhones"` SendType string `json:"send_type" faker:"-"` SendChannel int `json:"send_channel" faker:"boundary_start=1023, boundary_end=1023"` SendSucc bool `json:"send_succ" faker:"-"` ConstrictTime int `json:"constrict_time" faker:"boundary_start=30, boundary_end=120"` }
func (*AlertBody) MarkdownContent ¶
func (ab *AlertBody) MarkdownContent()
func (*AlertBody) Record2File ¶
func (ab *AlertBody) Record2File()
func (*AlertBody) SendSelfExternel ¶
func (*AlertBody) SendSelfInternal ¶
type BodyTransform ¶
type BodyTransform interface { JsonBody() (string, error) UrlParam() (string, error) PostParam() (string, error) }
func DetermineByApiName ¶
func DetermineByApiName(apiName string) BodyTransform
type HttpRequest ¶
type HttpRequest struct { Url string `json:"url"` // Method string `json:"method"` // Timeout time.Duration `json:"timeout"` // Params map[string]string `json:"params"` // Headers map[string]string `json:"headers"` // EnableTrace bool `json:"enable_trace"` DisableKeepalive bool `json:"disable_keepalive"` // //cert key Mtls map[string]string `json:"mtls"` // }
func AcquireHttpRequest ¶
func AcquireHttpRequest() *HttpRequest
func (*HttpRequest) Reset ¶
func (hr *HttpRequest) Reset()
type HttpResponse ¶
type HttpResponse struct { StatusCode int `json:"status_code"` ResponseContent []byte `json:"response_content"` ResponseHeader map[string][]string `json:"response_header"` Elapsed int64 `json:"elapsed"` Error error `json:"error"` Traces map[string]int64 `json:"traces"` }
func AcquireHttpResponse ¶
func AcquireHttpResponse() *HttpResponse
func (*HttpResponse) Reset ¶
func (hr *HttpResponse) Reset()
type MonitorResult ¶
func (*MonitorResult) DingdingContent ¶
func (mr *MonitorResult) DingdingContent(name string, siteAddress string) string
type SingSmSResp ¶
type SingleSmsReq ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.