Documentation ¶
Index ¶
- func GetAVP(message *ccrMessage, AVPToFind string) (interface{}, error)
- type GxAnswer
- type GxExpectation
- type PCRFServer
- func (srv *PCRFServer) AbortSession(_ context.Context, req *protos.AbortSessionRequest) (*protos.AbortSessionAnswer, error)
- func (srv *PCRFServer) AssertExpectations(_ context.Context, void *orcprotos.Void) (*protos.GxCreditControlResult, error)
- func (srv *PCRFServer) ClearSubscribers(_ context.Context, void *orcprotos.Void) (*orcprotos.Void, error)
- func (srv *PCRFServer) ConfigServer(_ context.Context, _ *protos.ServerConfiguration) (*orcprotos.Void, error)
- func (srv *PCRFServer) CreateAccount(_ context.Context, subscriberID *lteprotos.SubscriberID) (*orcprotos.Void, error)
- func (srv *PCRFServer) GetLastAVPreceived() (*diam.Message, error)
- func (srv *PCRFServer) GetRuleBaseNames(imsi string) ([]string, error)
- func (srv *PCRFServer) GetRuleDefinitions(imsi string) ([]*protos.RuleDefinition, error)
- func (srv *PCRFServer) GetRuleNames(imsi string) ([]string, error)
- func (srv *PCRFServer) ReAuth(ctx context.Context, target *protos.PolicyReAuthTarget) (*protos.PolicyReAuthAnswer, error)
- func (srv *PCRFServer) Reset(_ context.Context, _ *orcprotos.Void) (*orcprotos.Void, error)
- func (srv *PCRFServer) SetExpectations(_ context.Context, req *protos.GxCreditControlExpectations) (*orcprotos.Void, error)
- func (srv *PCRFServer) SetPCRFConfigs(_ context.Context, configs *protos.PCRFConfigs) (*orcprotos.Void, error)
- func (srv *PCRFServer) SetRules(_ context.Context, accountRules *protos.AccountRules) (*orcprotos.Void, error)
- func (srv *PCRFServer) SetUsageMonitors(_ context.Context, usageMonitorInfo *protos.UsageMonitorConfiguration) (*orcprotos.Void, error)
- func (srv *PCRFServer) Start(lis net.Listener) error
- func (srv *PCRFServer) StartListener() (net.Listener, error)
- type ReAuthAnswer
- type SubscriberSessionState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GxAnswer ¶
type GxAnswer struct {
*protos.GxCreditControlAnswer
}
type GxExpectation ¶
type GxExpectation struct {
*protos.GxCreditControlExpectation
}
Here we wrap the protobuf definitions to easily define instance methods
func (GxExpectation) DoesMatch ¶
func (e GxExpectation) DoesMatch(message interface{}) error
func (GxExpectation) GetAnswer ¶
func (e GxExpectation) GetAnswer() interface{}
type PCRFServer ¶
type PCRFServer struct {
// contains filtered or unexported fields
}
PCRFServer wraps an PCRF storing subscribers and their rules
func NewPCRFServer ¶
func NewPCRFServer(clientConfig *diameter.DiameterClientConfig, serverConfig *diameter.DiameterServerConfig) *PCRFServer
NewPCRFServer initializes an PCRF with an empty rule map Input: *sm.Settings containing the diameter related parameters
*TestPCRFConfig containing the server address
Output: a new PCRFServer
func (*PCRFServer) AbortSession ¶
func (srv *PCRFServer) AbortSession( _ context.Context, req *protos.AbortSessionRequest, ) (*protos.AbortSessionAnswer, error)
AbortSession call for a subscriber Initiate a Abort session request and provide the response
func (*PCRFServer) AssertExpectations ¶
func (srv *PCRFServer) AssertExpectations(_ context.Context, void *orcprotos.Void) (*protos.GxCreditControlResult, error)
func (*PCRFServer) ClearSubscribers ¶
func (srv *PCRFServer) ClearSubscribers(_ context.Context, void *orcprotos.Void) (*orcprotos.Void, error)
Reset eliminates all the subscribers allocated for the system.
func (*PCRFServer) ConfigServer ¶
func (srv *PCRFServer) ConfigServer( _ context.Context, _ *protos.ServerConfiguration, ) (*orcprotos.Void, error)
ConfigServer is an GRPC procedure which configure the server to respond to requests. It will be called from the gateway
func (*PCRFServer) CreateAccount ¶
func (srv *PCRFServer) CreateAccount( _ context.Context, subscriberID *lteprotos.SubscriberID, ) (*orcprotos.Void, error)
NewSubscriber adds a subscriber to the PCRF to be tracked Input: string containing the subscriber IMSI (can be in any form)
func (*PCRFServer) GetLastAVPreceived ¶
func (srv *PCRFServer) GetLastAVPreceived() (*diam.Message, error)
GetLastAVPreceived gets the last message in diam format received Message gets overwriten every time a new CCR is sent
func (*PCRFServer) GetRuleBaseNames ¶
func (srv *PCRFServer) GetRuleBaseNames(imsi string) ([]string, error)
GetRuleBaseNames returns all the rule base names set for a subscriber Input: string IMSI for the subscriber Output: []string containing all applicable rule base names
error if subscriber could not be found
func (*PCRFServer) GetRuleDefinitions ¶
func (srv *PCRFServer) GetRuleDefinitions( imsi string, ) ([]*protos.RuleDefinition, error)
GetRuleDefinitions returns all the dynamic rule definitions set for a subscriber Input: string IMSI for the subscriber Output: []*RuleDefinition containing all applicable rules
error if subscriber could not be found
func (*PCRFServer) GetRuleNames ¶
func (srv *PCRFServer) GetRuleNames(imsi string) ([]string, error)
GetRuleNames returns all the rules set for a subscriber Input: string IMSI for the subscriber Output: []string containing all applicable rules
error if subscriber could not be found
func (*PCRFServer) ReAuth ¶
func (srv *PCRFServer) ReAuth( ctx context.Context, target *protos.PolicyReAuthTarget, ) (*protos.PolicyReAuthAnswer, error)
ReAuth call for a subscriber Initiate a RAR requenst and handle a response
func (*PCRFServer) Reset ¶
Reset is an GRPC procedure which configure the server to the default status. It will be called from the gateway.
func (*PCRFServer) SetExpectations ¶
func (srv *PCRFServer) SetExpectations(_ context.Context, req *protos.GxCreditControlExpectations) (*orcprotos.Void, error)
func (*PCRFServer) SetPCRFConfigs ¶
func (srv *PCRFServer) SetPCRFConfigs( _ context.Context, configs *protos.PCRFConfigs, ) (*orcprotos.Void, error)
func (*PCRFServer) SetRules ¶
func (srv *PCRFServer) SetRules( _ context.Context, accountRules *protos.AccountRules, ) (*orcprotos.Void, error)
SetRules sets or overrides the rules applicable to the subscriber Input: imsi string IMSI for the subscriber
ruleNames []string containing all rule names to apply ruleBaseNames []string containing all rule base names to apply ruleDefinitions []*RuleDefinition containing all dynamic rules to apply
Output: error if subscriber could not be found
func (*PCRFServer) SetUsageMonitors ¶
func (srv *PCRFServer) SetUsageMonitors( _ context.Context, usageMonitorInfo *protos.UsageMonitorConfiguration, ) (*orcprotos.Void, error)
func (*PCRFServer) Start ¶
func (srv *PCRFServer) Start(lis net.Listener) error
Start begins the server and blocks, listening to the network Output: error if the server could not be started
func (*PCRFServer) StartListener ¶
func (srv *PCRFServer) StartListener() (net.Listener, error)
StartListener starts a listener based on ServerConfig If ServerConfig did not have valid values, default values would be used
type ReAuthAnswer ¶
type ReAuthAnswer struct { SessionID string `avp:"Session-Id"` ResultCode uint32 `avp:"Result-Code"` }
This is a temporary struct to handle unsupported AVP Charging-Rule-Report in go-diameter