Versions in this module Expand all Collapse all v0 v0.0.1 Aug 30, 2021 Changes in this version + const AppName + const Boundary + const FactoryResetEnabledDefault + const LevelDebug + const LevelInfo + const LevelWarn + const Linebreak + const MetricsEnabledDefault + const MsgpackContentType + const OkResponseTemplate + const TR181ResponseTemplate + var FirstLineBoundary = fmt.Sprintf("--%s\r\n", Boundary) + var LastLineBoundary = fmt.Sprintf("\r\n--%s--\r\n", Boundary) + var LineBoundary = fmt.Sprintf("\r\n--%s\r\n", Boundary) + var MultipartContentType = fmt.Sprintf("multipart/mixed; boundary=%s", Boundary) + var PokeBody = []byte(...) + func Error(w http.ResponseWriter, r *http.Request, status int, err error) + func GetUrlPattern(url string) string + func LogError(w http.ResponseWriter, r *http.Request, err error) + func NewTlsConfig(conf *configuration.Config) (*tls.Config, error) + func Validate(w http.ResponseWriter, r *http.Request, validateBody bool) (string, string, []byte, log.Fields, error) + func WebMetrics(m *AppMetrics, next http.Handler) http.Handler + func WriteContentTypeAndResponse(w http.ResponseWriter, r *http.Request, rbytes []byte, version string, ...) + func WriteErrorResponse(w http.ResponseWriter, r *http.Request, status int, err error) + func WriteFactoryResetResponse(w http.ResponseWriter) + func WriteMultipartResponse(w http.ResponseWriter, r *http.Request, o *MultipartOutput) + func WriteOkResponse(w http.ResponseWriter, r *http.Request, data interface{}) + func WriteOkResponseByTemplate(w http.ResponseWriter, r *http.Request, dataStr string) + func WriteResponseBytes(w http.ResponseWriter, r *http.Request, rbytes []byte, statusCode int, ...) + func WriteTR181Response(w http.ResponseWriter, r *http.Request, params string, version string) + type AppMetrics struct + func NewMetrics() *AppMetrics + type CodebigConnector struct + func NewCodebigConnector(conf *configuration.Config, satClientId, satClientSecret string, ...) *CodebigConnector + func (c *CodebigConnector) CodebigHost() string + func (c *CodebigConnector) GetToken(fields log.Fields, vargs ...string) (string, error) + func (c *CodebigConnector) SetCodebigHost(host string) + type CodebigResponse struct + AccessToken string + Description string + ExpiresIn int + ResponseCode int + Scope string + TokenType string + type ErrorResponse struct + Message string + type HttpClient struct + func NewHttpClient(conf *configuration.Config, serviceName string, tlsConfig *tls.Config) *HttpClient + func (c *HttpClient) Do(method string, url string, headers map[string]string, bbytes []byte, ...) ([]byte, error, bool) + func (c *HttpClient) DoWithRetries(method string, url string, inHeaders map[string]string, bbytes []byte, ...) ([]byte, error) + type MultipartOutput struct + func NewMultipartOutput(mparts []common.Multipart, rootVersion string) *MultipartOutput + func (o *MultipartOutput) Mparts() []common.Multipart + func (o *MultipartOutput) RootVersion() string + type PostTokenBody struct + Mac string + Ttl int64 + type WebconfigServer struct + func NewWebconfigServer(sc *common.ServerConfig, testOnly bool, dc db.DatabaseClient) *WebconfigServer + func (c *WebconfigServer) Poke(cpeMac string, token string, fields log.Fields) (string, error) + func (s *WebconfigServer) ApiMiddleware(next http.Handler) http.Handler + func (s *WebconfigServer) CpeMiddleware(next http.Handler) http.Handler + func (s *WebconfigServer) CreateTokenHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) DeleteDocumentHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) DeviceApiTokenAuthEnabled() bool + func (s *WebconfigServer) FactoryResetEnabled() bool + func (s *WebconfigServer) GetBaseRouter(testOnly bool) *mux.Router + func (s *WebconfigServer) GetDocumentHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) GetRouter(testOnly bool) *mux.Router + func (s *WebconfigServer) GetSupportedGroupsHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) MetricsEnabled() bool + func (s *WebconfigServer) MonitorHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) MultipartConfigHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) NoAuthMiddleware(next http.Handler) http.Handler + func (s *WebconfigServer) NotLoggedHeaders() []string + func (s *WebconfigServer) NotificationHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) PokeHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) PostDocumentHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) ServerApiTokenAuthEnabled() bool + func (s *WebconfigServer) ServerConfigHandler(w http.ResponseWriter, r *http.Request) + func (s *WebconfigServer) SetDeviceApiTokenAuthEnabled(enabled bool) + func (s *WebconfigServer) SetFactoryResetEnabled(enabled bool) + func (s *WebconfigServer) SetServerApiTokenAuthEnabled(enabled bool) + func (s *WebconfigServer) SetTokenApiEnabled(enabled bool) + func (s *WebconfigServer) TestingCpeMiddleware(next http.Handler) http.Handler + func (s *WebconfigServer) TestingMiddleware(next http.Handler) http.Handler + func (s *WebconfigServer) TlsConfig() *tls.Config + func (s *WebconfigServer) TokenApiEnabled() bool + func (s *WebconfigServer) VersionHandler(w http.ResponseWriter, r *http.Request) + type WebpaConnector struct + func NewWebpaConnector(conf *configuration.Config, tlsConfig *tls.Config) *WebpaConnector + func (c *WebpaConnector) Patch(cpeMac string, token string, bbytes []byte, fields log.Fields) (string, error) + func (c *WebpaConnector) SetWebpaHost(host string) + func (c *WebpaConnector) WebpaHost() string + type XpcResponseWriter struct + func NewXpcResponseWriter(w http.ResponseWriter, vargs ...interface{}) *XpcResponseWriter + func (w *XpcResponseWriter) Audit() log.Fields + func (w *XpcResponseWriter) AuditData(k string) string + func (w *XpcResponseWriter) AuditId() string + func (w *XpcResponseWriter) Body() string + func (w *XpcResponseWriter) Response() string + func (w *XpcResponseWriter) SetAuditData(k string, v interface{}) + func (w *XpcResponseWriter) SetBody(body string) + func (w *XpcResponseWriter) SetBodyObfuscated(obfuscated bool) + func (w *XpcResponseWriter) StartTime() time.Time + func (w *XpcResponseWriter) Status() int + func (w *XpcResponseWriter) String() string + func (w *XpcResponseWriter) Token() string + func (w *XpcResponseWriter) TraceId() string + func (w *XpcResponseWriter) Write(b []byte) (int, error) + func (w *XpcResponseWriter) WriteHeader(status int) + func (xw *XpcResponseWriter) LogDebug(r *http.Request, logger string, message string) + func (xw *XpcResponseWriter) LogInfo(r *http.Request, logger string, message string) + func (xw *XpcResponseWriter) LogWarn(r *http.Request, logger string, message string)