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
Index ¶
- Variables
- func NewFeatureInf() interface{}
- func NewFeatureRuleInf() interface{}
- func SetFeatureRule(id string, featureRule *FeatureRule) error
- type Feature
- type FeatureControl
- type FeatureEntity
- type FeatureLegacy
- type FeatureResponse
- type FeatureRule
- func (obj *FeatureRule) Clone() (*FeatureRule, error)
- func (obj *FeatureRule) GetApplicationType() string
- func (r *FeatureRule) GetID() string
- func (r *FeatureRule) GetId() string
- func (r *FeatureRule) GetName() string
- func (r *FeatureRule) GetPriority() int
- func (r *FeatureRule) GetRule() *re.Rule
- func (r *FeatureRule) GetRuleType() string
- func (r *FeatureRule) GetTemplateId() string
- func (obj *FeatureRule) SetApplicationType(appType string)
- func (r *FeatureRule) SetPriority(priority int)
- type PercentRange
- type WhitelistProperty
Constants ¶
This section is empty.
Variables ¶
View Source
var GetFeatureListFunc = GetFeatureRuleListForAS
Functions ¶
func NewFeatureRuleInf ¶
func NewFeatureRuleInf() interface{}
func SetFeatureRule ¶
func SetFeatureRule(id string, featureRule *FeatureRule) error
Types ¶
type Feature ¶
type Feature struct {
Properties map[string]interface{} `json:"properties,omitempty"`
ListType string `json:"listType,omitempty"`
ListSize int `json:"listSize,omitempty"`
ID string `json:"id,omitempty"`
Updated int64 `json:"updated,omitempty"`
Name string `json:"name"`
FeatureName string `json:"featureName,omitempty"`
EffectiveImmediate bool `json:"effectiveImmediate"`
Enable bool `json:"enable"`
Whitelisted bool `json:"whitelisted"`
ConfigData map[string]string `json:"configData"`
WhitelistProperty *WhitelistProperty `json:"whitelistProperty,omitempty"`
ApplicationType string `json:"applicationType,omitempty"`
}
Feature XconfFeature table
func GetFeatureList ¶
func GetFeatureList() []*Feature
func GetFeatureListForAS ¶
func GetFeatureListForAS() []*Feature
func GetOneFeature ¶
func (*Feature) CreateFeatureEntity ¶
func (obj *Feature) CreateFeatureEntity() *FeatureEntity
type FeatureControl ¶
type FeatureControl struct {
//set(FeatureResponse) should be defined as map[FeatureResponse]bool as golang set.
//but FeatureResponse is not comparable because it has map inside
FeatureResponses []FeatureResponse `json:"features"`
}
func NewFeatureControl ¶
func NewFeatureControl() *FeatureControl
NewFeatureControl to create a new FeatureControl
type FeatureEntity ¶
type FeatureEntity struct {
ID string `json:"id"`
Name string `json:"name"`
EffectiveImmediate bool `json:"effectiveImmediate"`
Enable bool `json:"enable"`
Whitelisted bool `json:"whitelisted"`
ConfigData map[string]string `json:"configData"`
WhitelistProperty *WhitelistProperty `json:"whitelistProperty,omitempty"`
ApplicationType string `json:"applicationType"`
FeatureName string `json:"featureName"`
FeatureInstance string `json:"featureInstance"`
}
API response object for Feature. Note that FeatureInstance attribute is the same as FeatureName and only used when importing/exporting a Feature.
func (*FeatureEntity) CreateFeature ¶
func (obj *FeatureEntity) CreateFeature() *Feature
func (*FeatureEntity) GetApplicationType ¶
func (obj *FeatureEntity) GetApplicationType() string
func (*FeatureEntity) SetApplicationType ¶
func (obj *FeatureEntity) SetApplicationType(appType string)
func (*FeatureEntity) UnmarshalJSON ¶
func (featureEntity *FeatureEntity) UnmarshalJSON(data []byte) error
type FeatureLegacy ¶
type FeatureLegacy struct {
ID string `json:"id"`
Name string `json:"name"`
EffectiveImmediate bool `json:"effectiveImmediate"`
Enable bool `json:"enable"`
ConfigData map[string]string `json:"configData"`
}
func NewFeatureLegacy ¶
func NewFeatureLegacy() *FeatureLegacy
NewFeatureLegacy to create a new FeatureLegacy
type FeatureResponse ¶
type FeatureResponse map[string]interface{}
func CreateFeatureResponseObject ¶
func CreateFeatureResponseObject(feature Feature) FeatureResponse
func (*FeatureResponse) MarshalJSON ¶
func (f *FeatureResponse) MarshalJSON() ([]byte, error)
type FeatureRule ¶
type FeatureRule struct {
Id string `json:"id"`
Name string `json:"name"`
Rule *re.Rule `json:"rule"`
Priority int `json:"priority"`
FeatureIds []string `json:"featureIds"`
ApplicationType string `json:"applicationType"`
}
FeatureRule FeatureControlRule2 table
func GetFeatureRuleList ¶
func GetFeatureRuleList() []*FeatureRule
func GetFeatureRuleListForAS ¶
func GetFeatureRuleListForAS() []*FeatureRule
func GetSortedFeatureRules ¶
func GetSortedFeatureRules() []*FeatureRule
GetFeatureControl returns FeatureRule sorted by Priority
func (*FeatureRule) Clone ¶
func (obj *FeatureRule) Clone() (*FeatureRule, error)
func (*FeatureRule) GetApplicationType ¶
func (obj *FeatureRule) GetApplicationType() string
func (*FeatureRule) GetID ¶
func (r *FeatureRule) GetID() string
func (*FeatureRule) GetPriority ¶
func (r *FeatureRule) GetPriority() int
func (*FeatureRule) GetRuleType ¶
func (r *FeatureRule) GetRuleType() string
GetRuleType XRule interface
func (*FeatureRule) GetTemplateId ¶
func (r *FeatureRule) GetTemplateId() string
GetTemplateId XRule interface
func (*FeatureRule) SetApplicationType ¶
func (obj *FeatureRule) SetApplicationType(appType string)
func (*FeatureRule) SetPriority ¶
func (r *FeatureRule) SetPriority(priority int)
type PercentRange ¶
func NewPercentRange ¶
func NewPercentRange() *PercentRange
NewPercentRange to create a new PercentRange
func (*PercentRange) Equals ¶
func (pr1 *PercentRange) Equals(pr2 *PercentRange) bool
type WhitelistProperty ¶
type WhitelistProperty struct {
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
NamespacedListType string `json:"namespacedListType,omitempty"`
TypeName string `json:"typeName,omitempty"`
}
func NewWhitelistProperty ¶
func NewWhitelistProperty() *WhitelistProperty
NewWhitelistProperty to create a new WhitelistProperty
Click to show internal directories.
Click to hide internal directories.