22 lines
466 B
Go
22 lines
466 B
Go
|
package client
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"git.loafle.net/overflow/overflow_probes/central/api/module"
|
||
|
"git.loafle.net/overflow/overflow_probes/config"
|
||
|
)
|
||
|
|
||
|
func ConnectToCentralAsProbe(c Client, entryURL string) (*http.Response, error) {
|
||
|
header := http.Header{}
|
||
|
header[module.ProbeHeader_ProbeKey] = []string{*config.CFG.Probe.Key}
|
||
|
|
||
|
var res *http.Response
|
||
|
var err error
|
||
|
if res, err = c.Dial(entryURL, header); nil != err {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
return res, nil
|
||
|
}
|