Documentation ¶
Overview ¶
Package apiserver provides an HTTP handler for sending and receiving SMS via an SMSC.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeliveryReceipt ¶
type DeliveryReceipt struct { Src string `json:"src"` Dst string `json:"dst"` Text string `json:"text"` }
DeliveryReceipt contains the arguments of RPC call to SM.Deliver. We only call it, not handle.
type Handler ¶
type Handler struct { http.Handler // Prefix of all endpoints served by the handler. // Defaults to "/" if not set. Prefix string // VersionTag that follows the prefix. // Defaults to "v1" if not set. VersionTag string // SMPP Transceiver for sending and receiving SMS. // Register will update its Handler and Bind it. Tx *smpp.Transceiver // contains filtered or unexported fields }
Handler is an HTTP handler that provides the endpoints of this service. It registers itself onto an existing ServeMux via Register.
type QueryMessage ¶
QueryMessage contains the arguments of RPC call to SM.Query.
type QueryMessageResp ¶
type QueryMessageResp struct { MsgState string `json:"message_state"` FinalDate string `json:"final_date"` ErrCode uint8 `json:"error_code"` }
QueryMessageResp contains RPC response from SM.Query.
type SM ¶
type SM struct {
// contains filtered or unexported fields
}
SM export its public methods to JSON RPC.
func NewSM ¶
func NewSM(tx *smpp.Transceiver, rs *rpc.Server) *SM
NewSM creates and initializes a new SM, registering its own methods onto the given rpc server.
func (*SM) Query ¶
func (rpc *SM) Query(args *QueryMessage, resp *QueryMessageResp) error
Query queries the status of a short message via RPC.
func (*SM) Submit ¶
func (rpc *SM) Submit(args *ShortMessage, resp *ShortMessageResp) error
Submit sends a short message via RPC.
type ShortMessage ¶
type ShortMessage struct { Src string `json:"src"` Dst string `json:"dst"` Text string `json:"text"` Enc string `json:"enc"` Register string `json:"register"` }
ShortMessage contains the arguments of RPC call to SM.Submit.
type ShortMessageResp ¶
type ShortMessageResp struct {
MessageID string `json:"message_id"`
}
ShortMessageResp contains of RPC response from SM.Submit.