Documentation
¶
Overview ¶
*
- Copyright 2022 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 2022 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 2022 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 2022 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 DownloadLocationRoundRobinFilterContainsVersion(firmwareVersions string, contextVersion string) bool
- func DownloadLocationRoundRobinFilterFilter(firmwareConfig *coreef.FirmwareConfigFacade, ...) bool
- func DownloadLocationRoundRobinFilterSetLocationByConnectionType(secureConnection bool, firmwareConfig *coreef.FirmwareConfigFacade, ...)
- func DownloadLocationRoundRobinFilterSetupIPv4Location(firmwareConfig *coreef.FirmwareConfigFacade, ...) bool
- func DownloadLocationRoundRobinFilterSetupIPv6Location(firmwareConfig *coreef.FirmwareConfigFacade, ...) bool
- func FitsPercentByAccountId(accountId string, percent float64) bool
- func GetNamespacedListById(typeName string, id string) *shared.GenericNamespacedList
- func IsIpInRange(ipAddressStr string, addressToCheck shared.IpAddress) bool
- func NullifyUnwantedFields(config *sharedef.FirmwareConfig) *sharedef.FirmwareConfig
- func PercentFilterfilter(evaluationResult *EvaluationResult, context *coreef.ConvertedContext) bool
- func SortByConditionsSize(rules []*corefw.FirmwareRule)
- type DefaultValue
- type EnvModelRuleService
- type EstbFirmwareRuleBase
- func (e *EstbFirmwareRuleBase) ApplyDefinePropertiesFilter(template *corefw.FirmwareRuleTemplate, firmwareRule *corefw.FirmwareRule, ...)
- func (e *EstbFirmwareRuleBase) ApplyMatchedFilters(rules map[string][]*corefw.FirmwareRule, ...) map[string]interface{}
- func (e *EstbFirmwareRuleBase) CheckForDRIState(ctx map[string]string, config *coreef.FirmwareConfigFacade, blocked bool) bool
- func (e *EstbFirmwareRuleBase) ConvertBasedOnValidationType(validationTypes []corefw.ValidationType, value string) (interface{}, error)
- func (e *EstbFirmwareRuleBase) ConvertProperties(template *corefw.FirmwareRuleTemplate, properties map[string]string) map[string]interface{}
- func (e *EstbFirmwareRuleBase) DoFilters(ctx map[string]string, convertedContext *coreef.ConvertedContext, ...) bool
- func (e *EstbFirmwareRuleBase) Eval(ctx map[string]string, convertedContext *coreef.ConvertedContext, ...) (*EvaluationResult, error)
- func (e *EstbFirmwareRuleBase) ExtractAnyPresentConfig(ruleAction *corefw.ApplicableAction) string
- func (e *EstbFirmwareRuleBase) ExtractConfigFromAction(context *coreef.ConvertedContext, ruleAction *corefw.ApplicableAction, ...) string
- func (e *EstbFirmwareRuleBase) FilterByAppType(rules []*corefw.FirmwareRule, applicationType string) map[string][]*corefw.FirmwareRule
- func (e *EstbFirmwareRuleBase) FilterByTemplate(firmwareRules []*corefw.FirmwareRule, templateName string) []*corefw.FirmwareRule
- func (e *EstbFirmwareRuleBase) FindMatchedRule(rules map[string][]*corefw.FirmwareRule, ...) *corefw.FirmwareRule
- func (e *EstbFirmwareRuleBase) FindMatchedRuleByRules(firmwareRules map[string][]*corefw.FirmwareRule, ...) *corefw.FirmwareRule
- func (e *EstbFirmwareRuleBase) FindMatchedRules(rules map[string][]*corefw.FirmwareRule, ...) []*corefw.FirmwareRule
- func (e *EstbFirmwareRuleBase) GetAppliedActivationVersionType(ctx map[string]string, applicationType string) *RunningVersionInfo
- func (e *EstbFirmwareRuleBase) GetBoundConfigId(ctx map[string]string, convertedContext *coreef.ConvertedContext, ...) string
- func (e *EstbFirmwareRuleBase) GetBseConfiguration(address *shared.IpAddress) (*coreef.BseConfiguration, error)
- func (e *EstbFirmwareRuleBase) GetSortedTemplate(actionType corefw.ApplicableActionType, reverse bool, fields log.Fields) []*corefw.FirmwareRuleTemplate
- func (e *EstbFirmwareRuleBase) GetSource(context *coreef.ConvertedContext, ruleAction *corefw.ApplicableAction) interface{}
- func (e *EstbFirmwareRuleBase) HasMinimumFirmware(ctx map[string]string) bool
- func (e *EstbFirmwareRuleBase) IsInWhitelist(convertedContext *coreef.ConvertedContext, whitelist string) bool
- func (e *EstbFirmwareRuleBase) IsIpAddressInRange(rule re.Rule, address *shared.IpAddress) bool
- func (e *EstbFirmwareRuleBase) MatchFirmwareVersionRegEx(regExs []string, firmwareVersion string) bool
- func (e *EstbFirmwareRuleBase) SetdriAlwaysReply(driAlwaysReply bool)
- func (e *EstbFirmwareRuleBase) SetdriStateIdentifiers(driStateIdentifiers string)
- func (e *EstbFirmwareRuleBase) SetruleProcessorFactory(ruleProcessorFactory *re.RuleProcessorFactory)
- func (e *EstbFirmwareRuleBase) SetupLocations(firmwareRule *corefw.FirmwareRule, config *coreef.BseConfiguration)
- type EvaluationResult
- type FirmwareRuleOfTemplate
- type IpFilterService
- type IpRuleService
- func (i *IpRuleService) ConvertToIpRuleOrReturnNull(firmwareRule *sharedfw.FirmwareRule) *sharedef.IpRuleBean
- func (i *IpRuleService) Delete(id string)
- func (i *IpRuleService) GetByApplicationType(applicationType string) []*sharedef.IpRuleBean
- func (i *IpRuleService) Save(bean *sharedef.IpRuleBean, applicationType string) error
- type MacRuleService
- func (m *MacRuleService) GetByApplicationType(applicationType string) []*sharedef.MacRuleBean
- func (m *MacRuleService) GetFirmwareMacRules(applicationType string) []*sharedfw.FirmwareRule
- func (m *MacRuleService) GetRulesWithMacCondition(applicationType string) []*sharedef.MacRuleBean
- func (m *MacRuleService) SearchMacRules(macPart string, applicationType string) []*sharedef.MacRuleBean
- type PercentFilterService
- type RunningVersionInfo
Constants ¶
const ( PERCENT_FILTER_NAME = "PercentFilter" FIRMWARE_SOURCE = "firmwareVersionSource" )
const ( BLOCKED DefaultValue = "BLOCKED" NOMATCH = "NOMATCH" NORULETYPE = "NORULETYPE" )
Variables ¶
This section is empty.
Functions ¶
func DownloadLocationRoundRobinFilterFilter ¶
func DownloadLocationRoundRobinFilterFilter(firmwareConfig *coreef.FirmwareConfigFacade, filterValue *coreef.DownloadLocationRoundRobinFilterValue, context *coreef.ConvertedContext) bool
DownloadLocationRoundRobinFilterFilter ... @return true if filter is applied, false otherwise
func DownloadLocationRoundRobinFilterSetLocationByConnectionType ¶
func DownloadLocationRoundRobinFilterSetLocationByConnectionType(secureConnection bool, firmwareConfig *coreef.FirmwareConfigFacade, fullHttpLocation string)
DownloadLocationRoundRobinFilterSetLocationByConnectionType ...
func DownloadLocationRoundRobinFilterSetupIPv4Location ¶
func DownloadLocationRoundRobinFilterSetupIPv4Location(firmwareConfig *coreef.FirmwareConfigFacade, filterValue *coreef.DownloadLocationRoundRobinFilterValue) bool
func DownloadLocationRoundRobinFilterSetupIPv6Location ¶
func DownloadLocationRoundRobinFilterSetupIPv6Location(firmwareConfig *coreef.FirmwareConfigFacade, filterValue *coreef.DownloadLocationRoundRobinFilterValue) bool
DownloadLocationRoundRobinFilterSetupIPv6Location ...
func FitsPercentByAccountId ¶
func GetNamespacedListById ¶
func GetNamespacedListById(typeName string, id string) *shared.GenericNamespacedList
func IsIpInRange ¶
TODO need to adjust
func NullifyUnwantedFields ¶
func NullifyUnwantedFields(config *sharedef.FirmwareConfig) *sharedef.FirmwareConfig
func PercentFilterfilter ¶
func PercentFilterfilter(evaluationResult *EvaluationResult, context *coreef.ConvertedContext) bool
*
- @return true if firmware output must be returned, false if must be blocked
func SortByConditionsSize ¶
func SortByConditionsSize(rules []*corefw.FirmwareRule)
Types ¶
type DefaultValue ¶
type DefaultValue string
type EnvModelRuleService ¶
type EnvModelRuleService struct {
}
func (*EnvModelRuleService) GetByApplicationType ¶
func (em *EnvModelRuleService) GetByApplicationType(applicationType string) []*sharedef.EnvModelBean
type EstbFirmwareRuleBase ¶
type EstbFirmwareRuleBase struct {
// contains filtered or unexported fields
}
EstbFirmwareRuleBase ...
func NewEstbFirmwareRuleBase ¶
func NewEstbFirmwareRuleBase(driAlwaysReply bool, driStateIdentifiers string) *EstbFirmwareRuleBase
NewEstbFirmwareRuleBase ...
func NewEstbFirmwareRuleBaseDefault ¶
func NewEstbFirmwareRuleBaseDefault() *EstbFirmwareRuleBase
NewEstbFirmwareRuleBaseDefault ...
func (*EstbFirmwareRuleBase) ApplyDefinePropertiesFilter ¶
func (e *EstbFirmwareRuleBase) ApplyDefinePropertiesFilter( template *corefw.FirmwareRuleTemplate, firmwareRule *corefw.FirmwareRule, action *corefw.ApplicableAction, properties map[string]interface{}, evaluationResult *EvaluationResult)
func (*EstbFirmwareRuleBase) ApplyMatchedFilters ¶
func (e *EstbFirmwareRuleBase) ApplyMatchedFilters( rules map[string][]*corefw.FirmwareRule, templateType corefw.ApplicableActionType, context map[string]string, bypassFilters map[string]struct{}, evaluationResult *EvaluationResult) map[string]interface{}
func (*EstbFirmwareRuleBase) CheckForDRIState ¶
func (e *EstbFirmwareRuleBase) CheckForDRIState(ctx map[string]string, config *coreef.FirmwareConfigFacade, blocked bool) bool
func (*EstbFirmwareRuleBase) ConvertBasedOnValidationType ¶
func (e *EstbFirmwareRuleBase) ConvertBasedOnValidationType(validationTypes []corefw.ValidationType, value string) (interface{}, error)
func (*EstbFirmwareRuleBase) ConvertProperties ¶
func (e *EstbFirmwareRuleBase) ConvertProperties(template *corefw.FirmwareRuleTemplate, properties map[string]string) map[string]interface{}
convertProperties ... using the DefinePropertiesTemplateAction value overwrite default config values
func (*EstbFirmwareRuleBase) DoFilters ¶
func (e *EstbFirmwareRuleBase) DoFilters(ctx map[string]string, convertedContext *coreef.ConvertedContext, applicationType string, rules map[string][]*corefw.FirmwareRule, evaluationResult *EvaluationResult, fields log.Fields) bool
func (*EstbFirmwareRuleBase) Eval ¶
func (e *EstbFirmwareRuleBase) Eval(ctx map[string]string, convertedContext *coreef.ConvertedContext, applicationType string, fields log.Fields) (*EvaluationResult, error)
Eval ... the main entry poinit to the module
func (*EstbFirmwareRuleBase) ExtractAnyPresentConfig ¶
func (e *EstbFirmwareRuleBase) ExtractAnyPresentConfig(ruleAction *corefw.ApplicableAction) string
func (*EstbFirmwareRuleBase) ExtractConfigFromAction ¶
func (e *EstbFirmwareRuleBase) ExtractConfigFromAction(context *coreef.ConvertedContext, ruleAction *corefw.ApplicableAction, appliedVersionInfo map[string]string) string
func (*EstbFirmwareRuleBase) FilterByAppType ¶
func (e *EstbFirmwareRuleBase) FilterByAppType(rules []*corefw.FirmwareRule, applicationType string) map[string][]*corefw.FirmwareRule
func (*EstbFirmwareRuleBase) FilterByTemplate ¶
func (e *EstbFirmwareRuleBase) FilterByTemplate(firmwareRules []*corefw.FirmwareRule, templateName string) []*corefw.FirmwareRule
func (*EstbFirmwareRuleBase) FindMatchedRule ¶
func (e *EstbFirmwareRuleBase) FindMatchedRule(rules map[string][]*corefw.FirmwareRule, templateType corefw.ApplicableActionType, contextMap map[string]string, bypassFilters map[string]struct{}, fields log.Fields) *corefw.FirmwareRule
func (*EstbFirmwareRuleBase) FindMatchedRuleByRules ¶
func (e *EstbFirmwareRuleBase) FindMatchedRuleByRules( firmwareRules map[string][]*corefw.FirmwareRule, actionType corefw.ApplicableActionType, template string, contextMap map[string]string, bypassFilters map[string]struct{}) *corefw.FirmwareRule
func (*EstbFirmwareRuleBase) FindMatchedRules ¶
func (e *EstbFirmwareRuleBase) FindMatchedRules(rules map[string][]*corefw.FirmwareRule, templateType corefw.ApplicableActionType, contextMap map[string]string, bypassFilters map[string]struct{}, isSingle bool, reverse bool, fields log.Fields) []*corefw.FirmwareRule
looking rule template/rule --> fiind matched rule with the context
func (*EstbFirmwareRuleBase) GetAppliedActivationVersionType ¶
func (e *EstbFirmwareRuleBase) GetAppliedActivationVersionType(ctx map[string]string, applicationType string) *RunningVersionInfo
func (*EstbFirmwareRuleBase) GetBoundConfigId ¶
func (e *EstbFirmwareRuleBase) GetBoundConfigId(ctx map[string]string, convertedContext *coreef.ConvertedContext, firmwareRule *corefw.FirmwareRule, appliedVersionInfo map[string]string) string
func (*EstbFirmwareRuleBase) GetBseConfiguration ¶
func (e *EstbFirmwareRuleBase) GetBseConfiguration(address *shared.IpAddress) (*coreef.BseConfiguration, error)
GetBseConfiguration ...
func (*EstbFirmwareRuleBase) GetSortedTemplate ¶
func (e *EstbFirmwareRuleBase) GetSortedTemplate(actionType corefw.ApplicableActionType, reverse bool, fields log.Fields) []*corefw.FirmwareRuleTemplate
GetSortedTemplate returns FirmwareRuleTemplate sorted by Priority
func (*EstbFirmwareRuleBase) GetSource ¶
func (e *EstbFirmwareRuleBase) GetSource(context *coreef.ConvertedContext, ruleAction *corefw.ApplicableAction) interface{}
func (*EstbFirmwareRuleBase) HasMinimumFirmware ¶
func (e *EstbFirmwareRuleBase) HasMinimumFirmware(ctx map[string]string) bool
HasMinimumFirmware ...
func (*EstbFirmwareRuleBase) IsInWhitelist ¶
func (e *EstbFirmwareRuleBase) IsInWhitelist(convertedContext *coreef.ConvertedContext, whitelist string) bool
func (*EstbFirmwareRuleBase) IsIpAddressInRange ¶
func (*EstbFirmwareRuleBase) MatchFirmwareVersionRegEx ¶
func (e *EstbFirmwareRuleBase) MatchFirmwareVersionRegEx(regExs []string, firmwareVersion string) bool
func (*EstbFirmwareRuleBase) SetdriAlwaysReply ¶
func (e *EstbFirmwareRuleBase) SetdriAlwaysReply(driAlwaysReply bool)
func (*EstbFirmwareRuleBase) SetdriStateIdentifiers ¶
func (e *EstbFirmwareRuleBase) SetdriStateIdentifiers(driStateIdentifiers string)
func (*EstbFirmwareRuleBase) SetruleProcessorFactory ¶
func (e *EstbFirmwareRuleBase) SetruleProcessorFactory(ruleProcessorFactory *re.RuleProcessorFactory)
func (*EstbFirmwareRuleBase) SetupLocations ¶
func (e *EstbFirmwareRuleBase) SetupLocations(firmwareRule *corefw.FirmwareRule, config *coreef.BseConfiguration)
type EvaluationResult ¶
type EvaluationResult struct {
MatchedRule *firmware.FirmwareRule `json:"matchedRule,omitempty"`
AppliedFilters []interface{} `json:"appliedFilters,omitempty"`
FirmwareConfig *coreef.FirmwareConfigFacade `json:"firmwareConfig"`
Description string `json:"description,omitempty"`
Blocked bool `json:"blocked,omitempty"`
AppliedVersionInfo map[string]string `json:"appliedVersionInfo,omitempty"`
}
EvaluationResult ...
func NewEvaluationResult ¶
func NewEvaluationResult() *EvaluationResult
func (*EvaluationResult) AddAppliedFilters ¶
func (e *EvaluationResult) AddAppliedFilters(filter interface{})
type FirmwareRuleOfTemplate ¶
type FirmwareRuleOfTemplate struct {
// contains filtered or unexported fields
}
the following is just simple code try to simulate collection applying filer concept it could be done simple Loop of rules, and check ruleType == tempalteName
type IpFilterService ¶
type IpFilterService struct {
}
type IpRuleService ¶
type IpRuleService struct {
}
func (*IpRuleService) ConvertToIpRuleOrReturnNull ¶
func (i *IpRuleService) ConvertToIpRuleOrReturnNull(firmwareRule *sharedfw.FirmwareRule) *sharedef.IpRuleBean
ConvertToIpRuleOrReturnNull ...
func (*IpRuleService) GetByApplicationType ¶
func (i *IpRuleService) GetByApplicationType(applicationType string) []*sharedef.IpRuleBean
GetByApplicationTyp ...
func (*IpRuleService) Save ¶
func (i *IpRuleService) Save(bean *sharedef.IpRuleBean, applicationType string) error
Save ...
type MacRuleService ¶
type MacRuleService struct {
}
func (*MacRuleService) GetByApplicationType ¶
func (m *MacRuleService) GetByApplicationType(applicationType string) []*sharedef.MacRuleBean
func (*MacRuleService) GetFirmwareMacRules ¶
func (m *MacRuleService) GetFirmwareMacRules(applicationType string) []*sharedfw.FirmwareRule
func (*MacRuleService) GetRulesWithMacCondition ¶
func (m *MacRuleService) GetRulesWithMacCondition(applicationType string) []*sharedef.MacRuleBean
func (*MacRuleService) SearchMacRules ¶
func (m *MacRuleService) SearchMacRules(macPart string, applicationType string) []*sharedef.MacRuleBean
type PercentFilterService ¶
type PercentFilterService struct {
}
func NewPercentFilterService ¶
func NewPercentFilterService() *PercentFilterService
func (*PercentFilterService) Save ¶
func (p *PercentFilterService) Save(filter *sharedef.PercentFilterValue, applicationType string)