Categorygithub.com/blorticus/smppth
modulepackage
0.4.1
Repository: https://github.com/blorticus/smppth.git
Documentation: pkg.go.dev

# README

smppth

Overview

This repository golang libraries intended to make the creating of SMPP test tools.

Libraries

github.com/blorticus/smpp provides methods for encoding and decoding SMPP PDUs. smppth adds SMPP Agents, which can operate as an ESME (meaning it initiates the outbound flow toward one or more peers) or an SMSC (meaning it listens for inbound flows from one or more peers). An AgentGroup instance is responsible for launching a group of agents and provides a method for routing PDUs to Agents for delivery to peers. The AgentGroup also provides an event channel. When specific events happen on an Agent, the Agent sends a message on the event channel describing that event. Events include:

  • Receipt of a PDU from a peer
  • Delivery of a PDU to a peer
  • Completion of a bind on a transport

The configuration of the Agents in an AgentGroup can be defined in a YAML file. A YAMLConfigReader can be used to read the YAML file, with the resulting objects supplied to the AgentGroup.

# Functions

NewAgentGroup creates a new AgentGroup and adds to it the provided list of managed agents.
NewApplicationConfigYamlReader creates a new, empty ApplicationConfigYamlReader.
NewDefaultPduFactory constructs a new DefaultPduFactory.
NewEsme creates an SMPP 3.4 client with the given name, and using the given IP and port for outgoing transport connections.
NewSMSC creates a new SMSC agent.
NewStandardApplication creates a new StandardApplication.
NewStandardOutputGenerator creates a new StandardOutputGenerator.
NewTextCommandProcessor creates a TextCommandProcessor.

# Constants

ApplicationError is the AgentEvent type when an Agent experiences some sort of error at the SMPP layer.
CompletedBind is the AgentEvent type when an agent completes a bind sequence with a peer.
CompletedUnbind is the AgentEvent type after an SMSC receives an unbind and sends an unbind-resp, or after an ESME sends an unbind and receives an ubind-resp.
Constants describing the type of user command instruction.
PeerTransportClosed is the AgentEvent type after the TCP transport toward a peer closes.
Constants describing the type of user command instruction.
ReceivedPDU is the AgentEvent type when an SMPP PDU is received from a peer.
Constants describing the type of user command instruction.
SentPDU is the AgentEvent type when the local Agent sent an SMPP PDU to a peer.
TransportError is the AgentEvent type when an Agent experiences some sort of error at the transport layer.

# Structs

AgentEvent is an event from an smpp agent.
AgentGroup manages a group of Agents, routing messages for delivery to them, and providing them with a common event channel.
ApplicationConfigYamlReader reads a testharness application YAML config file.
DefaultPduFactory produces a standard set of PDUs.
ESME represents an SMPP 3.4 client, which initiates one or more transport connections and sends binds on those connections.
A MessageDescriptor is provided to smpp agents, indicating what PDU to send, the name of the source from which to send, and the name of the destination to which the PDU should be sent.
SendPduDetails provides a structured set of details for an Agent, instructing it to send an SMPP PDU to a particular destination.
SMSC represents an SMPP 3.4 server, which accepts one or more transport connections and responds to bind requests.
StandardApplication provides a standard method for accepting user input commands (marshalled to UserCommand structs), generate smpp PDUs (if the command is 'SendPDU'), respond to known PDU types (e.g., send enquire-link-resp in response to an enquire-link), and produce standard text output to an io.Writer, based on a supplied OutputGenerator.
StandardOutputGenerator implements OutputGenerator, providing generic text responses for commands and events.
TextCommandProcessor accepts incoming text commands and, if they match the TextCommandProcessor syntax, then it emits a corresponding UserCommand structs.
UserCommand represents a user instruction provided to an Agent in an AgentGroup.

# Interfaces

Agent is either a testharness agent, either an ESME or an SMSC.
OutputGenerator is an inteface describing methods to generate standard responses to commands or events.
PduFactory instances produces smpp.PDU objects for various message types.

# Type aliases

AgentEventType is an enum of the types of AgentEvents that can be raised.
UserCommandType is the type of user command provided in a UserCommand struct.