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
Index ¶
- Constants
- Variables
- func ApplicableActionTypeToString(actionType ApplicableActionType) string
- func CreateFirmwareRuleOneDB(fr *FirmwareRule) error
- func CreateFirmwareRuleTemplateOneDB(ft *FirmwareRuleTemplate) error
- func DeleteOneFirmwareRule(id string) error
- func GetFirmwareRuleAllAsListByApplicationType(applicationType string) (map[string][]*FirmwareRule, error)
- func GetFirmwareRuleAllAsListByApplicationTypeForAS(applicationType string) (map[string][]*FirmwareRule, error)
- func HasFirmwareVersion(firmwareVersions []string, version string) bool
- func IsValidApplicableActionType(t ApplicableActionType) bool
- func NewBlockingFilterAction() interface{}
- func NewDefinePropertiesAction() interface{}
- func NewDefinePropertiesTemplateAction() interface{}
- func NewFirmwareRuleInf() interface{}
- func NewFirmwareRuleTemplateInf() interface{}
- func RemoveAllByRuleTypes(rules map[string][]*FirmwareRule, ruleType string)
- func SortConfigEntry(entries []*ConfigEntry)
- func ValidateRuleName(id string, name string, applicationType string) error
- type ActivationVersion
- type ApplicableAction
- type ApplicableActionType
- type BlockingFilterAction
- type ConfigEntry
- type DefinePropertiesAction
- type DefinePropertiesTemplateAction
- type FirmwareRule
- func GetEnvModelFirmwareRules(applicationType string) ([]*FirmwareRule, error)
- func GetEnvModelFirmwareRulesForAS(applicationType string) ([]*FirmwareRule, error)
- func GetFirmwareRuleAllAsListDB() ([]*FirmwareRule, error)
- func GetFirmwareRuleAllAsListDBForAdmin() ([]*FirmwareRule, error)
- func GetFirmwareRuleOneDB(id string) (*FirmwareRule, error)
- func GetFirmwareRulesByApplicationType(applicationType string) ([]*FirmwareRule, error)
- func GetFirmwareSortedRuleAllAsListDB() ([]*FirmwareRule, error)
- func GetRulesByRuleTypes(rules map[string][]*FirmwareRule, ruleType string) []*FirmwareRule
- func NewEmptyFirmwareRule() *FirmwareRule
- func NewFirmwareRule(id string, name string, ruleType string, rule *re.Rule, ...) *FirmwareRule
- func (obj *FirmwareRule) Clone() (*FirmwareRule, error)
- func (r *FirmwareRule) ConfigId() string
- func (r *FirmwareRule) Equals(f *FirmwareRule) bool
- func (obj *FirmwareRule) GetApplicationType() string
- func (r *FirmwareRule) GetId() string
- func (r *FirmwareRule) GetName() string
- func (r *FirmwareRule) GetRule() *re.Rule
- func (r *FirmwareRule) GetRuleType() string
- func (r *FirmwareRule) GetTemplateId() string
- func (r *FirmwareRule) IsNoop() bool
- func (obj *FirmwareRule) SetApplicationType(appType string)
- func (r *FirmwareRule) String() string
- func (r *FirmwareRule) Validate() error
- type FirmwareRuleTemplate
- func GetFirmwareRuleTemplateAllAsListByActionType(actionType ApplicableActionType) ([]*FirmwareRuleTemplate, error)
- func GetFirmwareRuleTemplateAllAsListDB(actionType ApplicableActionType) ([]*FirmwareRuleTemplate, error)
- func GetFirmwareRuleTemplateAllAsListDBForAS(actionType ApplicableActionType) ([]*FirmwareRuleTemplate, error)
- func GetFirmwareRuleTemplateOneDB(ruleType string) (*FirmwareRuleTemplate, error)
- func GetFirmwareRuleTemplateOneDBWithId(id string) (*FirmwareRuleTemplate, error)
- func NewEmptyFirmwareRuleTemplate() *FirmwareRuleTemplate
- func (obj *FirmwareRuleTemplate) Clone() (*FirmwareRuleTemplate, error)
- func (r *FirmwareRuleTemplate) GetID() string
- func (r *FirmwareRuleTemplate) GetId() string
- func (f *FirmwareRuleTemplate) GetName() string
- func (obj *FirmwareRuleTemplate) GetPriority() int
- func (r *FirmwareRuleTemplate) GetRule() *re.Rule
- func (f *FirmwareRuleTemplate) GetRuleType() string
- func (f *FirmwareRuleTemplate) GetTemplateId() string
- func (obj *FirmwareRuleTemplate) SetPriority(priority int)
- func (obj *FirmwareRuleTemplate) Validate() error
- type PropertyValue
- type RuleAction
- type TemplateApplicableAction
- type ValidationType
- type Void
Constants ¶
View Source
const ( MAC_RULE = "MAC_RULE" IP_RULE = "IP_RULE" ENV_MODEL_RULE = "ENV_MODEL_RULE" IP_FILTER = "IP_FILTER" TIME_FILTER = "TIME_FILTER" REBOOT_IMMEDIATELY_FILTER = "REBOOT_IMMEDIATELY_FILTER" DOWNLOAD_LOCATION_FILTER = "DOWNLOAD_LOCATION_FILTER" IV_RULE = "IV_RULE" MIN_CHECK_RULE = "MIN_CHECK_RULE" MIN_CHECK_RI = "MIN_CHECK_RI" GLOBAL_PERCENT = "GLOBAL_PERCENT" ACTIVATION_VERSION = "ACTIVATION_VERSION" KEY = "FREE_ARG" VALUE = "FIXED_ARG" )
View Source
const ( ApplicableActionClass = ".ApplicableAction" RuleActionClass = ".RuleAction" DefinePropertiesActionClass = ".DefinePropertiesAction" DefinePropertiesTemplateActionClass = ".DefinePropertiesTemplateAction" BlockingFilterActionClass = ".BlockingFilterAction" )
ApplicableAction's Type has to be one of these
View Source
const ( STRING ValidationType = "STRING" BOOLEAN = "BOOLEAN" NUMBER = "NUMBER" PERCENT = "PERCENT" PORT = "PORT" URL = "URL" IPV4 = "IPV4" IPV6 = "IPV6" )
View Source
const (
SINGLETON_ID = "DOWNLOAD_LOCATION_ROUND_ROBIN_FILTER_VALUE"
)
Variables ¶
View Source
var ( TemplateNames = []string{MAC_RULE, IP_RULE, ENV_MODEL_RULE, IP_FILTER, TIME_FILTER, REBOOT_IMMEDIATELY_FILTER, DOWNLOAD_LOCATION_FILTER, IV_RULE, MIN_CHECK_RULE, MIN_CHECK_RI, GLOBAL_PERCENT, ACTIVATION_VERSION} PercentFilterTemplateNames = []string{ENV_MODEL_RULE, MIN_CHECK_RULE, IV_RULE} )
Functions ¶
func ApplicableActionTypeToString ¶
func ApplicableActionTypeToString(actionType ApplicableActionType) string
func CreateFirmwareRuleOneDB ¶
func CreateFirmwareRuleOneDB(fr *FirmwareRule) error
func CreateFirmwareRuleTemplateOneDB ¶
func CreateFirmwareRuleTemplateOneDB(ft *FirmwareRuleTemplate) error
func DeleteOneFirmwareRule ¶
func GetFirmwareRuleAllAsListByApplicationType ¶
func GetFirmwareRuleAllAsListByApplicationType(applicationType string) (map[string][]*FirmwareRule, error)
func GetFirmwareRuleAllAsListByApplicationTypeForAS ¶
func GetFirmwareRuleAllAsListByApplicationTypeForAS(applicationType string) (map[string][]*FirmwareRule, error)
func HasFirmwareVersion ¶
func IsValidApplicableActionType ¶
func IsValidApplicableActionType(t ApplicableActionType) bool
func NewBlockingFilterAction ¶
func NewBlockingFilterAction() interface{}
func NewDefinePropertiesAction ¶
func NewDefinePropertiesAction() interface{}
func NewDefinePropertiesTemplateAction ¶
func NewDefinePropertiesTemplateAction() interface{}
func NewFirmwareRuleInf ¶
func NewFirmwareRuleInf() interface{}
func NewFirmwareRuleTemplateInf ¶
func NewFirmwareRuleTemplateInf() interface{}
func RemoveAllByRuleTypes ¶
func RemoveAllByRuleTypes(rules map[string][]*FirmwareRule, ruleType string)
func SortConfigEntry ¶
func SortConfigEntry(entries []*ConfigEntry)
Types ¶
type ActivationVersion ¶
type ActivationVersion struct {
ID string `json:"id"`
ApplicationType string `json:"applicationType,omitempty"`
Description string `json:"description,omitempty"`
Model string `json:"model,omitempty"`
PartnerId string `json:"partnerId,omitempty"`
RegularExpressions []string `json:"regularExpressions"`
FirmwareVersions []string `json:"firmwareVersions"`
}
func NewActivationVersion ¶
func NewActivationVersion() *ActivationVersion
NewActivationVersion constructor
func (*ActivationVersion) GetApplicationType ¶
func (obj *ActivationVersion) GetApplicationType() string
getApplicationType implements queries.T.
func (*ActivationVersion) SetApplicationType ¶
func (obj *ActivationVersion) SetApplicationType(appType string)
setApplicationType implements queries.T.
type ApplicableAction ¶
type ApplicableAction struct {
Type string `json:"type"`
ActionType ApplicableActionType `json:"actionType,omitempty"`
ConfigId string `json:"configId,omitempty"`
ConfigEntries []ConfigEntry `json:"configEntries"` // RuleAction
Active bool `json:"active"`
UseAccountPercentage bool `json:"useAccountPercentage"`
FirmwareCheckRequired bool `json:"firmwareCheckRequired"`
RebootImmediately bool `json:"rebootImmediately"`
Whitelist string `json:"whitelist,omitempty"`
IntermediateVersion string `json:"intermediateVersion,omitempty"`
FirmwareVersions []string `json:"firmwareVersions,omitempty"`
Properties map[string]string `json:"properties,omitempty"` // DefinePropertiesAction
ByPassFilters []string `json:"byPassFilters,omitempty"`
ActivationFirmwareVersions map[string][]string `json:"activationFirmwareVersions,omitempty"`
}
FirmwareRule FirmwareRule4 table
func NewApplicableAction ¶
func NewApplicableAction(typ string, configId string) *ApplicableAction
func NewApplicableActionAndType ¶
func NewApplicableActionAndType(typ string, actionType ApplicableActionType, configId string) *ApplicableAction
func (*ApplicableAction) GetFirmwareVersionRegExs ¶
func (d *ApplicableAction) GetFirmwareVersionRegExs() []string
func (*ApplicableAction) GetFirmwareVersions ¶
func (d *ApplicableAction) GetFirmwareVersions() []string
func (ApplicableAction) IsValid ¶
func (a ApplicableAction) IsValid() bool
func (ApplicableAction) String ¶
func (a ApplicableAction) String() string
type ApplicableActionType ¶
type ApplicableActionType string
const ( RULE ApplicableActionType = "RULE" DEFINE_PROPERTIES ApplicableActionType = "DEFINE_PROPERTIES" BLOCKING_FILTER ApplicableActionType = "BLOCKING_FILTER" RULE_TEMPLATE ApplicableActionType = "RULE_TEMPLATE" DEFINE_PROPERTIES_TEMPLATE ApplicableActionType = "DEFINE_PROPERTIES_TEMPLATE" BLOCKING_FILTER_TEMPLATE ApplicableActionType = "BLOCKING_FILTER_TEMPLATE" )
func (*ApplicableActionType) CaseIgnoreEquals ¶
func (this *ApplicableActionType) CaseIgnoreEquals(that ApplicableActionType) bool
func (*ApplicableActionType) IsSuperSetOf ¶
func (this *ApplicableActionType) IsSuperSetOf(that *ApplicableActionType) bool
type BlockingFilterAction ¶
type BlockingFilterAction struct {
ApplicableAction
}
BlockingFilterAction ...
type ConfigEntry ¶
type ConfigEntry struct {
ConfigId string `json:"configId"`
Percentage float64 `json:"percentage"`
StartPercentRange float64 `json:"startPercentRange"`
EndPercentRange float64 `json:"endPercentRange"`
IsPaused bool `json:"isPaused"`
IsCanaryDisabled bool `json:"isCanaryDisabled"`
}
func NewConfigEntry ¶
func NewConfigEntry(configId string, startPercentRange float64, endPercentRange float64) *ConfigEntry
func (*ConfigEntry) CompareTo ¶
func (c *ConfigEntry) CompareTo(configEntry *ConfigEntry) int
func (*ConfigEntry) Equals ¶
func (c *ConfigEntry) Equals(configEntry *ConfigEntry) bool
type DefinePropertiesAction ¶
type DefinePropertiesAction struct {
ApplicableAction
Properties map[string]PropertyValue `json:"properties"`
ByPassFilters []string `json:"byPassFilters"`
ActivationFirmwareVersions map[string][]string `json:"activationFirmwareVersions"`
}
DefinePropertiesAction ...
type DefinePropertiesTemplateAction ¶
type DefinePropertiesTemplateAction struct {
ApplicableAction
Properties map[string]PropertyValue `json:"properties"`
ByPassFilters []string `json:"byPassFilters"`
ActivationFirmwareVersions map[string][]string `json:"activationFirmwareVersions"`
}
DefinePropertiesTemplateAction ...
type FirmwareRule ¶
type FirmwareRule struct {
ID string `json:"id"`
Updated int64 `json:"updated"`
Name string `json:"name"`
ApplicableAction *ApplicableAction `json:"applicableAction"`
Rule re.Rule `json:"rule"`
Type string `json:"type"`
Active bool `json:"active"`
ApplicationType string `json:"applicationType,omitempty"`
}
FirmwareRule FirmwareRule4 table
func GetEnvModelFirmwareRules ¶
func GetEnvModelFirmwareRules(applicationType string) ([]*FirmwareRule, error)
func GetEnvModelFirmwareRulesForAS ¶
func GetEnvModelFirmwareRulesForAS(applicationType string) ([]*FirmwareRule, error)
func GetFirmwareRuleAllAsListDB ¶
func GetFirmwareRuleAllAsListDB() ([]*FirmwareRule, error)
func GetFirmwareRuleAllAsListDBForAdmin ¶
func GetFirmwareRuleAllAsListDBForAdmin() ([]*FirmwareRule, error)
func GetFirmwareRuleOneDB ¶
func GetFirmwareRuleOneDB(id string) (*FirmwareRule, error)
func GetFirmwareRulesByApplicationType ¶
func GetFirmwareRulesByApplicationType(applicationType string) ([]*FirmwareRule, error)
func GetFirmwareSortedRuleAllAsListDB ¶
func GetFirmwareSortedRuleAllAsListDB() ([]*FirmwareRule, error)
GetFirmwareSortedRuleAllAsListDB returns all FirmwareRule sorted by Name
func GetRulesByRuleTypes ¶
func GetRulesByRuleTypes(rules map[string][]*FirmwareRule, ruleType string) []*FirmwareRule
GetRulesByRuleTypes ...
func NewEmptyFirmwareRule ¶
func NewEmptyFirmwareRule() *FirmwareRule
func NewFirmwareRule ¶
func NewFirmwareRule(id string, name string, ruleType string, rule *re.Rule, action *ApplicableAction, active bool) *FirmwareRule
func (*FirmwareRule) Clone ¶
func (obj *FirmwareRule) Clone() (*FirmwareRule, error)
func (*FirmwareRule) ConfigId ¶
func (r *FirmwareRule) ConfigId() string
func (*FirmwareRule) Equals ¶
func (r *FirmwareRule) Equals(f *FirmwareRule) bool
func (*FirmwareRule) GetApplicationType ¶
func (obj *FirmwareRule) GetApplicationType() string
func (*FirmwareRule) GetRuleType ¶
func (r *FirmwareRule) GetRuleType() string
GetRuleType XRule interface
func (*FirmwareRule) GetTemplateId ¶
func (r *FirmwareRule) GetTemplateId() string
GetTemplateId XRule interface
func (*FirmwareRule) SetApplicationType ¶
func (obj *FirmwareRule) SetApplicationType(appType string)
func (*FirmwareRule) String ¶
func (r *FirmwareRule) String() string
func (*FirmwareRule) Validate ¶
func (r *FirmwareRule) Validate() error
type FirmwareRuleTemplate ¶
type FirmwareRuleTemplate struct {
ID string `json:"id"`
Updated int64 `json:"updated,omitempty"`
Rule re.Rule `json:"rule"`
ApplicableAction *TemplateApplicableAction `json:"applicableAction"`
Priority int32 `json:"priority"`
RequiredFields []string `json:"requiredFields,omitempty"`
ByPassFilters []string `json:"byPassFilters,omitempty"`
ValidationExpression string `json:"validationExpression,omitempty"`
Editable bool `json:"editable"`
}
FirmwareRuleTemplate table
func GetFirmwareRuleTemplateAllAsListByActionType ¶
func GetFirmwareRuleTemplateAllAsListByActionType(actionType ApplicableActionType) ([]*FirmwareRuleTemplate, error)
func GetFirmwareRuleTemplateAllAsListDB ¶
func GetFirmwareRuleTemplateAllAsListDB(actionType ApplicableActionType) ([]*FirmwareRuleTemplate, error)
func GetFirmwareRuleTemplateAllAsListDBForAS ¶
func GetFirmwareRuleTemplateAllAsListDBForAS(actionType ApplicableActionType) ([]*FirmwareRuleTemplate, error)
func GetFirmwareRuleTemplateOneDB ¶
func GetFirmwareRuleTemplateOneDB(ruleType string) (*FirmwareRuleTemplate, error)
func GetFirmwareRuleTemplateOneDBWithId ¶
func GetFirmwareRuleTemplateOneDBWithId(id string) (*FirmwareRuleTemplate, error)
func NewEmptyFirmwareRuleTemplate ¶
func NewEmptyFirmwareRuleTemplate() *FirmwareRuleTemplate
func (*FirmwareRuleTemplate) Clone ¶
func (obj *FirmwareRuleTemplate) Clone() (*FirmwareRuleTemplate, error)
func (*FirmwareRuleTemplate) GetID ¶
func (r *FirmwareRuleTemplate) GetID() string
func (*FirmwareRuleTemplate) GetId ¶
func (r *FirmwareRuleTemplate) GetId() string
GetId XRule interface
func (*FirmwareRuleTemplate) GetName ¶
func (f *FirmwareRuleTemplate) GetName() string
GetName XRule interface
func (*FirmwareRuleTemplate) GetPriority ¶
func (obj *FirmwareRuleTemplate) GetPriority() int
func (*FirmwareRuleTemplate) GetRule ¶
func (r *FirmwareRuleTemplate) GetRule() *re.Rule
GetRule XRule interface
func (*FirmwareRuleTemplate) GetRuleType ¶
func (f *FirmwareRuleTemplate) GetRuleType() string
GetRuleType XRule interface
func (*FirmwareRuleTemplate) GetTemplateId ¶
func (f *FirmwareRuleTemplate) GetTemplateId() string
GetTemplateId XRule interface
func (*FirmwareRuleTemplate) SetPriority ¶
func (obj *FirmwareRuleTemplate) SetPriority(priority int)
func (*FirmwareRuleTemplate) Validate ¶
func (obj *FirmwareRuleTemplate) Validate() error
type PropertyValue ¶
type PropertyValue struct {
Value string `json:"value"`
Optional bool `json:"optional"`
ValidationTypes []ValidationType `json:"validationTypes"`
}
func NewPropertyValue ¶
func NewPropertyValue(value string, optional bool, vtype ValidationType) *PropertyValue
type RuleAction ¶
type RuleAction struct {
ApplicableAction
ConfigId string `json:"configId"`
ConfigEntries []ConfigEntry `json:"configEntries"`
Active bool `json:"active"`
UseAccountPercentage bool `json:"useAccountPercentage"`
FirmwareCheckRequired bool `json:"firmwareCheckRequired"`
RebootImmediately bool `json:"rebootImmediately"`
Whitelist string `json:"whitelist"`
IntermediateVersion string `json:"intermediateVersion"`
FirmwareVersions []string `json:"firmwareVersions"`
}
RuleAction ...
func NewRuleAction ¶
func NewRuleAction() *RuleAction
type TemplateApplicableAction ¶
type TemplateApplicableAction struct {
Type string `json:"type"`
ActionType ApplicableActionType `json:"actionType"`
ConfigId string `json:"configI,omitempty"`
ConfigEntries []ConfigEntry `json:"configEntries,omitempty"` // RuleAction
Active bool `json:"active"`
UseAccountPercentage bool `json:"useAccountPercentage"`
FirmwareCheckRequired bool `json:"firmwareCheckRequired"`
RebootImmediately bool `json:"rebootImmediately"`
Whitelist string `json:"whitelist,omitempty"`
IntermediateVersion string `json:"intermediateVersion,omitempty"`
FirmwareVersions []string `json:"firmwareVersions,omitempty"`
Properties map[string]PropertyValue `json:"properties,omitempty"` // DefinePropertiesAction
ByPassFilters []string `json:"byPassFilters,omitempty"`
ActivationFirmwareVersions map[string][]string `json:"activationFirmwareVersions,omitempty"`
}
func NewTemplateApplicableAction ¶
func NewTemplateApplicableAction(typ string, configId string) *TemplateApplicableAction
func NewTemplateApplicableActionAndType ¶
func NewTemplateApplicableActionAndType(typ string, actionType ApplicableActionType, configId string) *TemplateApplicableAction
type ValidationType ¶
type ValidationType string
Click to show internal directories.
Click to hide internal directories.