overflow_probes/client/central/socket_builders.go
crusader 2551703bc2 ing
2017-12-09 17:41:43 +09:00

36 lines
848 B
Go

package central
import (
"net/http"
oocmp "git.loafle.net/overflow/overflow_commons_go/modules/probe"
oopccc "git.loafle.net/overflow/overflow_probes/commons/central/client"
"git.loafle.net/overflow/overflow_probes/config"
)
func NewSocketBuilder(entryPath string) *SocketBuilders {
sb := &SocketBuilders{}
sb.SocketBuilders = oopccc.NewSocketBuilder(entryPath)
if nil == sb.SocketBuilders {
return nil
}
return sb
}
type SocketBuilders struct {
*oopccc.SocketBuilders
}
func (sb *SocketBuilders) GetRequestHeader() http.Header {
header := http.Header{}
header.Set(oocmp.HTTPRequestHeaderKey_Probe_Method, oocmp.HTTPRequestHeaderValue_Probe_Method_Connect)
header.Set(oocmp.HTTPRequestHeaderKey_Probe_ProbeKey, *config.Config.Probe.Key)
return header
}
func (sb *SocketBuilders) Validate() {
sb.SocketBuilders.Validate()
}