Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomNumber ¶
func GenerateRandomNumber() int
Types ¶
type AcceptFunc ¶
type AcceptFunc func(data map[string]interface{})
type Notification ¶
type Notification struct {
Notification bool `json:"notification"`
Method string `json:"method"`
Data map[string]interface{} `json:"data"`
}
* Notification
{
notification : true,
method : 'chatmessage',
data :
{
foo : 'bar'
}
}
type Peer ¶
func (*Peer) Request ¶
func (peer *Peer) Request(method string, data map[string]interface{}, success AcceptFunc, reject RejectFunc)
type RejectFunc ¶
type Request ¶
type Request struct {
Request bool `json:"request"`
Id int `json:"id"`
Method string `json:"method"`
Data map[string]interface{} `json:"data"`
}
* Request
{
request : true,
id : 12345678,
method : 'chatmessage',
data :
{
type : 'text',
value : 'Hi there!'
}
}
type Response ¶
type Response struct {
Response bool `json:"response"`
Id int `json:"id"`
Ok bool `json:"ok"`
Data map[string]interface{} `json:"data"`
}
* Success response
{
response : true,
id : 12345678,
ok : true,
data :
{
foo : 'lalala'
}
}
type ResponseError ¶
type ResponseError struct {
Response bool `json:"response"`
Id int `json:"id"`
Ok bool `json:"ok"`
ErrorCode int `json:"errorCode"`
ErrorReason string `json:"errorReason"`
}
* Error response
{
response : true,
id : 12345678,
ok : false,
errorCode : 123,
errorReason : 'Something failed'
}
type Transcation ¶
type Transcation struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.