Documentation ¶
Index ¶
- Constants
- type ExpiredSubscriptionCb
- type NewWebsocketCb
- type PeriodicSubscriptionCb
- type Subscription
- type SubscriptionCfg
- type SubscriptionMgr
- func (sm *SubscriptionMgr) CreateSubscription(cfg *SubscriptionCfg, jsonSubOrig string) (*Subscription, error)
- func (sm *SubscriptionMgr) DeleteAllSubscriptions() error
- func (sm *SubscriptionMgr) DeleteFilteredSubscriptions(AppId string, Type string) error
- func (sm *SubscriptionMgr) DeleteSubscription(sub *Subscription) error
- func (sm *SubscriptionMgr) GenerateSubscriptionId() string
- func (sm *SubscriptionMgr) GetAllSubscriptions() ([]*Subscription, error)
- func (sm *SubscriptionMgr) GetFilteredSubscriptions(AppId string, Type string) ([]*Subscription, error)
- func (sm *SubscriptionMgr) GetSubscription(Id string) (*Subscription, error)
- func (sm *SubscriptionMgr) ReadyToSend(sub *Subscription) bool
- func (sm *SubscriptionMgr) SendNotification(sub *Subscription, notif []byte) error
- func (sm *SubscriptionMgr) SetSubscriptionJson(sub *Subscription, jsonSub string) error
- func (sm *SubscriptionMgr) UpdateSubscription(sub *Subscription) error
- type SubscriptionMgrCfg
- type TestNotificationCb
Constants ¶
View Source
const ( ModeDirect = "Direct" ModeWebsocket = "Websocket" )
View Source
const ( StateInit = "Init" StateReady = "Ready" StateTestNotif = "TestNotif" StateExpired = "Expired" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpiredSubscriptionCb ¶
type ExpiredSubscriptionCb func(*Subscription)
type NewWebsocketCb ¶
type NewWebsocketCb func(*Subscription) (string, error)
type PeriodicSubscriptionCb ¶
type PeriodicSubscriptionCb func(*Subscription)
type Subscription ¶
type Subscription struct { Cfg *SubscriptionCfg JsonSubOrig string `json:"jsonSubOrig"` Mode string `json:"mode"` State string `json:"state"` PeriodicCounter int32 `json:"periodicCounter"` TestNotifSent bool `json:"testNotifSent"` WsCreated bool `json:"wsCreated"` HttpClient *http.Client `json:"-"` Ws *ws.Websocket WsTransport *ws.Transport3gppWsNotif `json:"-"` }
type SubscriptionCfg ¶
type SubscriptionCfg struct { Id string `json:"id"` AppId string `json:"appId"` Type string `json:"subType"` NotifType string `json:"notifType"` Self string `json:"self"` NotifyUrl string `json:"notifyUrl"` ExpiryTime *time.Time `json:"expiryTime"` PeriodicInterval int32 `json:"periodicInterval"` RequestTestNotif bool `json:"reqTestNotif"` RequestWebsocketUri bool `json:"reqWebsockUri"` }
type SubscriptionMgr ¶
type SubscriptionMgr struct {
// contains filtered or unexported fields
}
func NewSubscriptionMgr ¶
func NewSubscriptionMgr(cfg *SubscriptionMgrCfg, addr string) (sm *SubscriptionMgr, err error)
NewSubscriptionMgr - Create and initialize a Subscription Manager instance
func (*SubscriptionMgr) CreateSubscription ¶
func (sm *SubscriptionMgr) CreateSubscription(cfg *SubscriptionCfg, jsonSubOrig string) (*Subscription, error)
func (*SubscriptionMgr) DeleteAllSubscriptions ¶
func (sm *SubscriptionMgr) DeleteAllSubscriptions() error
func (*SubscriptionMgr) DeleteFilteredSubscriptions ¶
func (sm *SubscriptionMgr) DeleteFilteredSubscriptions(AppId string, Type string) error
func (*SubscriptionMgr) DeleteSubscription ¶
func (sm *SubscriptionMgr) DeleteSubscription(sub *Subscription) error
func (*SubscriptionMgr) GenerateSubscriptionId ¶
func (sm *SubscriptionMgr) GenerateSubscriptionId() string
func (*SubscriptionMgr) GetAllSubscriptions ¶
func (sm *SubscriptionMgr) GetAllSubscriptions() ([]*Subscription, error)
func (*SubscriptionMgr) GetFilteredSubscriptions ¶
func (sm *SubscriptionMgr) GetFilteredSubscriptions(AppId string, Type string) ([]*Subscription, error)
func (*SubscriptionMgr) GetSubscription ¶
func (sm *SubscriptionMgr) GetSubscription(Id string) (*Subscription, error)
func (*SubscriptionMgr) ReadyToSend ¶
func (sm *SubscriptionMgr) ReadyToSend(sub *Subscription) bool
func (*SubscriptionMgr) SendNotification ¶
func (sm *SubscriptionMgr) SendNotification(sub *Subscription, notif []byte) error
func (*SubscriptionMgr) SetSubscriptionJson ¶
func (sm *SubscriptionMgr) SetSubscriptionJson(sub *Subscription, jsonSub string) error
func (*SubscriptionMgr) UpdateSubscription ¶
func (sm *SubscriptionMgr) UpdateSubscription(sub *Subscription) error
type SubscriptionMgrCfg ¶
type SubscriptionMgrCfg struct { Module string Sandbox string Mep string Service string Basekey string MetricsEnabled bool ExpiredSubCb ExpiredSubscriptionCb PeriodicSubCb PeriodicSubscriptionCb TestNotifCb TestNotificationCb NewWsCb NewWebsocketCb }
type TestNotificationCb ¶
type TestNotificationCb func(*Subscription) error
Click to show internal directories.
Click to hide internal directories.