mq

package module
v0.0.0-...-8f6edbe Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

View Source
const TargetAll = "all"

Variables

This section is empty.

Functions

func GetGlobalName

func GetGlobalName() string

GetGlobalName - Get global queue name

func GetLocalName

func GetLocalName(namespace string) string

GetLocalName - Get local namespace-specific queue name

func PrintMsg

func PrintMsg(msg *Msg) string

Convert message to string

Types

type Message

type Message string

Messages

const (
	// Sandbox Control
	MsgSandboxCreate  Message = "SANDBOX-CREATE"
	MsgSandboxDestroy Message = "SANDBOX-DESTROY"

	// Scenario Management
	MsgScenarioActivate  Message = "SCENARIO-ACTIVATE"
	MsgScenarioUpdate    Message = "SCENARIO-UPDATE"
	MsgScenarioTerminate Message = "SCENARIO-TERMINATE"

	// PDU Session Management
	MsgPduSessionCreated    Message = "PDU-SESSION-CREATED"
	MsgPduSessionTerminated Message = "PDU-SESSION-TERMINATED"

	// Mobility Groups
	MsgMgLbRulesUpdate Message = "MG-LB-RULES-UPDATE"

	// Traffic Control
	MsgTcLbRulesUpdate  Message = "TC-LB-RULES-UPDATE"
	MsgTcNetRulesUpdate Message = "TC-NET-RULES-UPDATE"

	// GIS Engine
	MsgGeUpdate Message = "GIS-ENGINE-UPDATE"

	// Applications
	MsgAppUpdate    Message = "APP-UPDATE"
	MsgAppRemove    Message = "APP-REMOVE"
	MsgAppRemoveCnf Message = "APP-REMOVE-CNF"
	MsgAppFlush     Message = "APP-FLUSH"

	// MEC Services
	MsgMecSvcUpdate Message = "MEC-SVC-UPDATE"

	// API
	MsgApiUpdate  Message = "API-UPDATE"
	MsgApiRequest Message = "API-REQUEST"

	// Watchdog
	MsgPing Message = "PING"
	MsgPong Message = "PONG"
)

type Msg

type Msg struct {
	SrcName      string            `json:"src,omitempty"`
	SrcNamespace string            `json:"src-ns,omitempty"`
	DstName      string            `json:"dst,omitempty"`
	DstNamespace string            `json:"dst-ns,omitempty"`
	Scope        string            `json:"scope,omitempty"`
	Message      Message           `json:"msg,omitempty"`
	Payload      map[string]string `json:"payload,omitempty"`
}

type MsgHandler

type MsgHandler struct {
	Handler  func(msg *Msg, userData interface{})
	UserData interface{}
}

type MsgQueue

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

func NewMsgQueue

func NewMsgQueue(name string, moduleName string, moduleNamespace string, addr string) (*MsgQueue, error)

MsgQueue - Creates and initialize a Message Queue instance

func (*MsgQueue) CreateMsg

func (mq *MsgQueue) CreateMsg(message Message, dstName string, dstNamespace string) *Msg

CreateMsg - Create a new message

func (*MsgQueue) RegisterHandler

func (mq *MsgQueue) RegisterHandler(handler MsgHandler) (id int, err error)

Register - Add a message handler

func (*MsgQueue) SendMsg

func (mq *MsgQueue) SendMsg(msg *Msg) error

SendMsg - Send the provided message

func (*MsgQueue) UnregisterHandler

func (mq *MsgQueue) UnregisterHandler(id int)

Unregister - Remove a message handler

Jump to

Keyboard shortcuts

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