policydb

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBaseNameDeserializer

func GetBaseNameDeserializer() object_store.Deserializer

func GetBaseNameSerializer

func GetBaseNameSerializer() object_store.Serializer

func GetFlowDescriptionFromFlowString

func GetFlowDescriptionFromFlowString(descriptorStr string) (*protos.FlowDescription, error)

GetFlowDescriptionFromFlowString returns a proto.FlowDescription from a IPFilterRule string passed in the Flow-Description AVP. This AVP can have many variations, but follows the format:

action direction proto from src to dst

e.g.:

permit out ip from 1.2.3.0/24 to any

func GetPolicyDeserializer

func GetPolicyDeserializer() object_store.Deserializer

func GetPolicySerializer

func GetPolicySerializer() object_store.Serializer

func GetRuleMappingDeserializer

func GetRuleMappingDeserializer() object_store.Deserializer

func GetRuleMappingSerializer

func GetRuleMappingSerializer() object_store.Serializer

Types

type BaseNameStreamListener

type BaseNameStreamListener struct {
	// contains filtered or unexported fields
}

func NewBaseNameStreamListener

func NewBaseNameStreamListener(streamMap object_store.ObjectMap) *BaseNameStreamListener

func (*BaseNameStreamListener) GetExtraArgs

func (listener *BaseNameStreamListener) GetExtraArgs() *any.Any

func (*BaseNameStreamListener) GetName

func (listener *BaseNameStreamListener) GetName() string

Gateway Streamer Listener Interface Implementation

func (*BaseNameStreamListener) ReportError

func (listener *BaseNameStreamListener) ReportError(e error) error

func (*BaseNameStreamListener) Update

func (listener *BaseNameStreamListener) Update(ub *orcprotos.DataUpdateBatch) bool

type ChargingKey

type ChargingKey struct {
	RatingGroup       uint32
	ServiceIdTracking bool
	ServiceIdentifier uint32
}

ChargingKey defines a reporting key for a charging rule the key could be the policy RatingGroup or RatingGroup and Service Identity combo

func CreateChargingKey

func CreateChargingKey(rule *protos.PolicyRule) ChargingKey

CreateChargingKey creates & returns ChargingKey from a given policy

func (ChargingKey) String

func (k ChargingKey) String() string

type OmnipresentRulesStreamListener

type OmnipresentRulesStreamListener struct {
	// contains filtered or unexported fields
}

func NewOmnipresentRulesListener

func NewOmnipresentRulesListener(streamMap object_store.ObjectMap) *OmnipresentRulesStreamListener

func (*OmnipresentRulesStreamListener) GetExtraArgs

func (listener *OmnipresentRulesStreamListener) GetExtraArgs() *any.Any

func (*OmnipresentRulesStreamListener) GetName

func (listener *OmnipresentRulesStreamListener) GetName() string

Gateway Streamer Listener Interface Implementation

func (*OmnipresentRulesStreamListener) ReportError

func (listener *OmnipresentRulesStreamListener) ReportError(e error) error

func (*OmnipresentRulesStreamListener) Update

func (listener *OmnipresentRulesStreamListener) Update(ub *orcprotos.DataUpdateBatch) bool

type PolicyDBClient

type PolicyDBClient interface {
	GetChargingKeysForRules(ruleIDs []string, ruleDefs []*protos.PolicyRule) []ChargingKey
	GetPolicyRuleByID(id string) (*protos.PolicyRule, error)
	GetRuleIDsForBaseNames(baseNames []string) []string
	// This gets a list of rules that should be active for all subscribers in the network
	GetOmnipresentRules() ([]string, []string)
}

PolicyDBClient defines interactions with the stored policy rules

type PolicyDBStreamListener

type PolicyDBStreamListener struct {
	// contains filtered or unexported fields
}

func NewPolicyDBStreamListener

func NewPolicyDBStreamListener(streamMap object_store.ObjectMap) *PolicyDBStreamListener

func (*PolicyDBStreamListener) GetExtraArgs

func (listener *PolicyDBStreamListener) GetExtraArgs() *any.Any

func (*PolicyDBStreamListener) GetName

func (listener *PolicyDBStreamListener) GetName() string

Gateway Streamer Listener Interface Implementation

func (*PolicyDBStreamListener) ReportError

func (listener *PolicyDBStreamListener) ReportError(e error) error

func (*PolicyDBStreamListener) Update

func (listener *PolicyDBStreamListener) Update(ub *orcprotos.DataUpdateBatch) bool

type RedisPolicyDBClient

type RedisPolicyDBClient struct {
	PolicyMap        object_store.ObjectMap
	BaseNameMap      object_store.ObjectMap
	OmnipresentRules object_store.ObjectMap
	StreamerClient   streamer.Client
}

RedisPolicyDBClient is a policy client that loads policies from Redis

func NewRedisPolicyDBClient

func NewRedisPolicyDBClient(reg service_registry.GatewayRegistry) (*RedisPolicyDBClient, error)

NewRedisPolicyDBClient creates a new RedisPolicyDBClient

func (*RedisPolicyDBClient) GetChargingKeysForRules

func (client *RedisPolicyDBClient) GetChargingKeysForRules(staticRuleIDs []string, dynamicRuleDefs []*protos.PolicyRule) []ChargingKey

GetChargingKeysForRules retrieves the charging keys associated with the given rule names from redis.

func (*RedisPolicyDBClient) GetOmnipresentRules

func (client *RedisPolicyDBClient) GetOmnipresentRules() ([]string, []string)

func (*RedisPolicyDBClient) GetPolicyRuleByID

func (client *RedisPolicyDBClient) GetPolicyRuleByID(id string) (*protos.PolicyRule, error)

GetPolicyRuleByID returns a policy from its ID from redis

func (*RedisPolicyDBClient) GetRuleIDsForBaseNames

func (client *RedisPolicyDBClient) GetRuleIDsForBaseNames(baseNames []string) []string

GetRuleIDsForBaseNames gets the policy rule ids for given charging rule base names. These base name mappings are stored into redis through the stream client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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