Documentation ¶
Index ¶
- Variables
- func DeclareNetworkCategory(category networkcategory.NetworkCategory)
- func HttpDownlod(url string, filePath string) error
- func HttpGet(url string) (error, string)
- func HttpPost(url string, data string, contentType string) (string, error)
- func RequestNetcheck(requestType NetcheckRequestType)
- type CheckReport
- type NetcheckRequestType
Constants ¶
This section is empty.
Variables ¶
var (
ErrNetworkCategoryNotDetected = errors.New("Network category has not been detected")
)
Functions ¶
func DeclareNetworkCategory ¶
func DeclareNetworkCategory(category networkcategory.NetworkCategory)
DeclareNetworkCategory sets the network category in cache of this module, which is used to specify the network environment when running netcheck program.
func HttpDownlod ¶
HttpDownload simply directly calls util.HttpDownload function without wrapping
func HttpGet ¶
HttpGet calls util.HttpGet with wrapping code which issue network diagnostic when encoutering network error
func HttpPost ¶
HttpPost calls util.HttpPost with wrapping code which issue network diagnostic when encoutering network error
func RequestNetcheck ¶
func RequestNetcheck(requestType NetcheckRequestType)
RequestNetcheck would asynchronously invoke netcheck program for network diagnostic, when no other network diagnostic is running or the last diagnostic report has outdated.
Types ¶
type CheckReport ¶
func RecentReport ¶
func RecentReport() *CheckReport
RecentReport would return the most recent available network diagnostic report, or nil pointer if the report has not been generated. When the report has been outdated, it would call RequestNetcheck to refresh netcheck report.
type NetcheckRequestType ¶
type NetcheckRequestType string
const ( NetcheckRequestNormal NetcheckRequestType = "normal" NetcheckRequestForceOnce NetcheckRequestType = "forceOnce" )