servicers

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: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CentralSessionController

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

CentralSessionController acts as the gRPC server for accepting calls from gateways to start new UE sessions and retrieve traffic policy and credits.

func NewCentralSessionController

func NewCentralSessionController(
	creditClient gy.CreditClient,
	policyClient gx.PolicyClient,
	dbClient policydb.PolicyDBClient,
	cfg *SessionControllerConfig,
) *CentralSessionController

NewCentralSessionController constructs a CentralSessionController and registers external handlers

func (*CentralSessionController) CreateSession

CreateSession begins a UE session by requesting rules from PCEF and credit from OCS (if RatingGroup is present) and returning them.

func (*CentralSessionController) Disable

Disable closes all existing diameter connections and disables connection creation for the time specified in the request

func (*CentralSessionController) Enable

func (srv *CentralSessionController) Enable(
	ctx context.Context,
	void *orcprotos.Void,
) (*orcprotos.Void, error)

Enable enables diameter connection creation and gets a connection to the diameter server(s). If creation is already enabled and a connection already exists, Enable has no effect

func (*CentralSessionController) GetHealthStatus

func (srv *CentralSessionController) GetHealthStatus(
	ctx context.Context,
	void *orcprotos.Void,
) (*fegprotos.HealthStatus, error)

GetHealthStatus retrieves a health status object which contains the current health of the service

func (*CentralSessionController) TerminateSession

TerminateSession handles a session termination by sending single CCR-T on Gx sending CCR-T per rating group on Gy

func (*CentralSessionController) UpdateSession

UpdateSession handles periodic updates from gateways that include quota exhaustion and terminations.

type CentralSessionControllerServerWithHealth

type CentralSessionControllerServerWithHealth interface {
	protos.CentralSessionControllerServer
	fegprotos.ServiceHealthServer
}

CentralSessionControllerServerWithHealth is an interface just to group CentralSessionControllerServer and ServiceHealthServer. This is used by NewCentralSessionControllerWithHealth to be able to return either CentralSessionControllers or CentralSessionController (without S)

func NewCentralSessionControllerDefaultMultiplexWithHealth

func NewCentralSessionControllerDefaultMultiplexWithHealth(
	controlParam []*ControllerParam,
	dbClient policydb.PolicyDBClient,
) (CentralSessionControllerServerWithHealth, error)

NewCentralSessionControllerDefaultMultiplesWithHealth returns a different type of controller depending on the amount of servers configured. In case only one server is configured, there is no need to calculate where this subscriber should be sent, so in that case we return CentralSessionController (without S). In case of multiple servers configured, it creates a CentralSessionControllers and uses a **StaticMultiplexByIMSI** as a multiplexor

type CentralSessionControllers

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

func NewCentralSessionControllers

func NewCentralSessionControllers(
	controlParam []*ControllerParam,
	dbClient policydb.PolicyDBClient,
	mux multiplex.Multiplexor,
) *CentralSessionControllers

NewCentralSessionControllers creates centralControllers which is a slice of centralController. This should be used only if more than one server is configred

func (*CentralSessionControllers) CreateSession

CreateSession begins a UE session by requesting rules from PCEF and credit from OCS (if RatingGroup is present) and returning them.

func (*CentralSessionControllers) Disable

Disable closes all existing diameter connections and disables connection creation for the time specified in the request

func (*CentralSessionControllers) Enable

func (srv *CentralSessionControllers) Enable(
	ctx context.Context,
	void *orcprotos.Void,
) (*orcprotos.Void, error)

Enable enables diameter connection creation and gets a connection to the diameter server(s). if creation is already enabled and a connection already exists, enable has no effect

func (*CentralSessionControllers) GetHealthStatus

func (srv *CentralSessionControllers) GetHealthStatus(
	ctx context.Context,
	void *orcprotos.Void,
) (*fegprotos.HealthStatus, error)

GetHealthStatus retrieves a health status object which contains the current health of the service

func (*CentralSessionControllers) TerminateSession

TerminateSession handles a session termination by sending single ccr-t on gx sending ccr-t per rating group on gy.

func (*CentralSessionControllers) UpdateSession

UpdateSession handles periodic updates from gateways that include quota exhaustion and terminations

type ControllerParam

type ControllerParam struct {
	CreditClient gy.CreditClient
	PolicyClient gx.PolicyClient
	Config       *SessionControllerConfig
}

type SessionControllerConfig

type SessionControllerConfig struct {
	OCSConfig      *diameter.DiameterServerConfig
	PCRFConfig     *diameter.DiameterServerConfig
	RequestTimeout time.Duration
	InitMethod     gy.InitMethod
	// This flag enables a specific type of behavior.
	// 1. Ensures a Gy CCR-I is called in CreateSession when Gx CCR-I succeeds,
	// even if there is no rating group returned by Gx CCR-A.
	// 2. Ensures all Multi Service Credit Control entities have 2001 result
	// code for CreateSession to succeed.
	UseGyForAuthOnly bool
	DisableGx        bool
	DisableGy        bool
}

SessionControllerConfig stores all the needed configuration for running gx and gy clients

Jump to

Keyboard shortcuts

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