Documentation
¶
Overview ¶
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
* * Copyright 2021 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func AppendProfiles(pbytes, sbytes []byte) ([]byte, error)
- func BuildHttp(header http.Header, bbytes []byte) []byte
- func CaseInsensitiveContains(data []string, x string) bool
- func CompactJson(sbytes []byte) ([]byte, error)
- func Contains(collection interface{}, element interface{}) bool
- func ContainsInt(data []int, x int) bool
- func FieldsGetString(fields log.Fields, keyName string, args ...string) string
- func GenerateRandomCpeMac() string
- func GetAPIName(queryStr string) string
- func GetAuditId() string
- func GetEstbMacAddress(mac string) string
- func GetMacDiff(wanMac, mac string) int
- func GetMockMultiparts(queryStr string) []common.Multipart
- func GetMurmur3Hash(payload []byte) string
- func GetMurmur3HashByTwmb(payload []byte) string
- func GetRandomRootVersion() string
- func GetTelemetryQueryString(header http.Header, mac, queryParams, partnerId string) string
- func HeaderToMap(header http.Header) map[string]string
- func IsValidUTF8(bbytes []byte) bool
- func ParseHttp(bbytes []byte) (http.Header, []byte)
- func ParseMultipart(header http.Header, bbytes []byte) (map[string]common.Multipart, error)
- func ParseMultipartAsList(header http.Header, bbytes []byte) ([]common.Multipart, error)
- func PrettyJson(input interface{}) string
- func TelemetryBytesToMultipart(telemetryBytes []byte) (common.Multipart, error)
- func ToColonMac(d string) string
- func ToInt(itf interface{}) int
- func ValidateMac(mac string) bool
- func ValidatePokeQuery(values url.Values) (string, error)
- func ValidateQueryParams(r *http.Request, validSubdocIdMap map[string]int, fields log.Fields) error
- type Dict
- func (d Dict) Copy() Dict
- func (d Dict) GetBool(key string, defaults ...bool) bool
- func (d Dict) GetInt(key string, defaults ...int) int
- func (d Dict) GetNonEmptyString(key string, defaults ...string) string
- func (d Dict) GetString(key string, defaults ...string) string
- func (d Dict) MsecsToTime(fields ...string)
- func (d Dict) SelectByKeys(names ...string) Dict
- func (d Dict) String() string
- func (d Dict) TimeToMsecs(field string)
- func (d Dict) ToInt(fields ...string)
- func (d Dict) ToInt64(fields ...string)
- func (d Dict) Update(itf interface{})
Constants ¶
const ( Comma = ',' RightSquareBracket = ']' RightCurlBracket = '}' )
Variables ¶
This section is empty.
Functions ¶
func AppendProfiles ¶ added in v1.0.0
func CaseInsensitiveContains ¶
func CompactJson ¶ added in v1.0.0
func ContainsInt ¶
TODO keep it for backward compatibility in "webconfig" for now
plan to remove it later
func FieldsGetString ¶ added in v1.0.0
func GenerateRandomCpeMac ¶
func GenerateRandomCpeMac() string
func GetAPIName ¶ added in v1.0.0
func GetAuditId ¶
func GetAuditId() string
func GetEstbMacAddress ¶ added in v1.0.0
func GetMacDiff ¶ added in v1.0.0
func GetMockMultiparts ¶ added in v1.0.0
func GetMurmur3Hash ¶
func GetMurmur3HashByTwmb ¶
my benchmark test showed this is better by a small margin
func GetRandomRootVersion ¶ added in v1.0.0
func GetRandomRootVersion() string
func GetTelemetryQueryString ¶ added in v1.0.0
func IsValidUTF8 ¶ added in v1.0.0
func ParseMultipart ¶
func ParseMultipartAsList ¶
func PrettyJson ¶
func PrettyJson(input interface{}) string
func TelemetryBytesToMultipart ¶ added in v1.0.0
func ToColonMac ¶
func ValidateMac ¶
Types ¶
type Dict ¶
type Dict map[string]interface{}