package client import ( "net/http" "git.loafle.net/commons_go/logging" cwfc "git.loafle.net/commons_go/websocket_fasthttp/client" oocmn "git.loafle.net/overflow/overflow_commons_go/modules/noauthprobe" oopas "git.loafle.net/overflow/overflow_probes/auth/service" oopcc "git.loafle.net/overflow/overflow_probes/central/client" ) func NewSocketBuilder(napService *oopas.NoAuthProbeService) cwfc.SocketBuilder { sb := &SocketBuilders{ napService: napService, } sb.SocketBuilders = oopcc.NewSocketBuilder(oocmn.HTTPEntry_NoAuthProbe) if nil == sb.SocketBuilders { return nil } return sb } type SocketBuilders struct { *oopcc.SocketBuilders napService *oopas.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") } }