Documentation
¶
Overview ¶
Package httpdrv defines two http based drivers.
Both drivers send notification to endpoint
Index ¶
Constants ¶
View Source
const GET = "HTTPGET"
GET is driver type of HTTPGet()
View Source
const POST = "HTTPPOST"
POST is driver type of HTTPPost()
Variables ¶
This section is empty.
Functions ¶
func DefaultValidator ¶
DefaultValidator determines http status code is 2xx, or error is returned
Types ¶
type GetMsg ¶
type GetMsg struct {
// additional headers to send
Headers http.Header `json:"headers,omitempty"`
// url query string to send. the value is encoded and appended to endpoint
Values url.Values `json:"values,omitempty"`
}
GetMsg defines driver specific parameters for HTTPGet()
type PostMsg ¶
type PostMsg struct {
// additional header to send
Headers http.Header `json:"headers"`
// post body
Body []byte `json:"body"`
}
PostMsg defines driver specific parameters for HTTPPost()
func FormPostMsg ¶
func JSONPostMsg ¶
type Validator ¶
Validator defines user-provided function to determine if response is success or failed.
func StringValidator ¶
StringValidator creates a Validator which determines response body begins with specified string, or error is returned
Click to show internal directories.
Click to hide internal directories.