package probe import ( "net/http" "git.loafle.net/commons_go/logging" cwfc "git.loafle.net/commons_go/websocket_fasthttp/client" oocmp "git.loafle.net/overflow/overflow_commons_go/modules/probe" oopcc "git.loafle.net/overflow/overflow_probes/central/client" oops "git.loafle.net/overflow/overflow_probes/service" ) func NewSocketBuilder(napService *oops.NoAuthProbeService) cwfc.SocketBuilder { sb := &SocketBuilders{ napService: napService, } sb.SocketBuilders = oopcc.NewSocketBuilder(oocmp.HTTPEntry_Probe) if nil == sb.SocketBuilders { return nil } return sb } type SocketBuilders struct { *oopcc.SocketBuilders napService *oops.NoAuthProbeService } func (sb *SocketBuilders) SocketHandler() cwfc.SocketHandler { return newSocketHandler(sb.napService) } func (sb *SocketBuilders) GetRequestHeader() http.Header { h := sb.napService.GetRequestHeader() header := http.Header{} for k, v := range h { header[k] = v } return header } func (sb *SocketBuilders) Validate() { sb.SocketBuilders.Validate() if nil == sb.napService { logging.Logger().Panic("Auth: NoAuthProbeService must be specified") } }