Documentation ¶
Overview ¶
Copyright 2014 hey Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 hey Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type HttpWork
- type MqttWork
- func (this *MqttWork) Connect(opts *MQTT.ClientOptions) error
- func (this *MqttWork) Finish()
- func (this *MqttWork) GetClient() MQTT.Client
- func (this *MqttWork) GetDefaultOptions(addrURI string) *MQTT.ClientOptions
- func (this *MqttWork) On(topic string, callback func(client MQTT.Client, msg MQTT.Message))
- func (this *MqttWork) Request(ctx context.Context, topic string, body []byte) (MQTT.Message, error)
- func (this *MqttWork) RequestNR(topic string, body []byte)
- func (this *MqttWork) RequestURI(ctx context.Context, u *url.URL, body []byte) (MQTT.Message, error)
- func (this *MqttWork) RequestURINR(url *url.URL, body []byte)
- type Report
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpWork ¶
type HttpWork struct { // H2 is an option to make HTTP/2 requests H2 bool // Timeout in seconds. Timeout int // DisableCompression is an option to disable compression in response DisableCompression bool // DisableKeepAlives is an option to prevents re-use of TCP connections between different HTTP requests DisableKeepAlives bool // DisableRedirects is an option to prevent the following of HTTP redirects DisableRedirects bool // ProxyAddr is the address of HTTP proxy server in the format on "host:port". // Optional. ProxyAddr *url.URL // contains filtered or unexported fields }
func (*HttpWork) CloneRequest ¶
cloneRequest returns a clone of the provided *http.Request. The clone is a shallow copy of the struct and its Header map.
type MqttWork ¶
type MqttWork struct {
// contains filtered or unexported fields
}
func (*MqttWork) GetDefaultOptions ¶
func (this *MqttWork) GetDefaultOptions(addrURI string) *MQTT.ClientOptions
type Result ¶
type Result struct { Err error StatusCode int Duration time.Duration ConnDuration time.Duration // connection setup(DNS lookup + Dial up) duration DnsDuration time.Duration // dns lookup duration ReqDuration time.Duration // request "write" duration ResDuration time.Duration // response "read" duration DelayDuration time.Duration // delay between response and request ContentLength int64 Body []byte }