rfc

package
v1.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: Apache-2.0, BSD-3-Clause Imports: 12 Imported by: 3

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

Constants

This section is empty.

Variables

View Source
var GetFeatureListFunc = GetFeatureRuleListForAS

Functions

func NewFeatureInf

func NewFeatureInf() interface{}

NewFeatureInf to create a new Feature

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 GetOneFeature(featureId string) *Feature

func NewFeature

func NewFeature() *Feature

NewFeature to create a new Feature

func (*Feature) Clone

func (obj *Feature) Clone() (*Feature, error)

func (*Feature) CreateFeatureEntity

func (obj *Feature) CreateFeatureEntity() *FeatureEntity

func (*Feature) ToString

func (f *Feature) ToString() string

Feature ToString ...

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) GetId

func (r *FeatureRule) GetId() string

GetId XRule interface

func (*FeatureRule) GetName

func (r *FeatureRule) GetName() string

GetName XRule interface

func (*FeatureRule) GetPriority

func (r *FeatureRule) GetPriority() int

func (*FeatureRule) GetRule

func (r *FeatureRule) GetRule() *re.Rule

GetRule XRule interface

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

type PercentRange struct {
	StartRange float64
	EndRange   float64
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL