Documentation
¶
Index ¶
- type Client
- func (c *Client) GetBalance() (int, error)
- func (c *Client) GetMessages(count int) ([]Message, error)
- func (c *Client) GetMid(uid int) (int64, error)
- func (c *Client) GetStatuses(mids []int64) ([]DeliveryStatus, error)
- func (c *Client) Send(request SendRequest) ([]SendResponse, error)
- func (c *Client) SetBaseUrl(url string)
- type CustomTime
- type DeliveryStatus
- type Message
- type SendRequest
- type SendResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is magfa service client that has multiple methods to communicate with magfa services
func (*Client) GetBalance ¶
GetBalance of account from magfa
func (*Client) GetMessages ¶
GetMessages that received to magfa servers
func (*Client) GetStatuses ¶
func (c *Client) GetStatuses(mids []int64) ([]DeliveryStatus, error)
GetStatuses of delivery for a list of mid
func (*Client) Send ¶
func (c *Client) Send(request SendRequest) ([]SendResponse, error)
Send a send request to magfa server
func (*Client) SetBaseUrl ¶
SetBaseUrl to magfa client for change url address
type CustomTime ¶
CustomTime structure
func (*CustomTime) UnmarshalJSON ¶
func (ct *CustomTime) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON is custom unmarshaller for Date objects
type DeliveryStatus ¶
type DeliveryStatus struct {
Mid int64
Status int
StatusText string
Date CustomTime
}
DeliveryStatus is structure that contain status and date of each message
type Message ¶
type Message struct {
Body string
SenderNumber string
RecipientNumber string
Date CustomTime
}
Message is structure of received message
type SendRequest ¶
type SendRequest struct {
Senders []string `json:"senders,omitempty"`
Recipients []string `json:"recipients,omitempty"`
Messages []string `json:"messages,omitempty"`
Encodings []int `json:"encodings,omitempty"`
Uids []int64 `json:"uids,omitempty"`
Udhs []string `json:"udhs,omitempty"`
}
SendRequest is structure of send sms requests with senders, recipients, messages and etc.
Click to show internal directories.
Click to hide internal directories.