Documentation ¶
Index ¶
- Constants
- type ConnResult
- type ForwardRequest
- type Message
- type MessageContainer
- type MultiPeer
- func (self *MultiPeer) AddPeer(p UniqushConnPeer)
- func (self *MultiPeer) CheckUserStatus(req *UserStatusQuery) *Result
- func (self *MultiPeer) Forward(req *ForwardRequest) *Result
- func (self *MultiPeer) Id() string
- func (self *MultiPeer) Redirect(req *RedirectRequest) *Result
- func (self *MultiPeer) Send(req *SendRequest) *Result
- type RedirectRequest
- type Result
- type SendRequest
- type SubscribeRequest
- type UniqushConnInstance
- func (self *UniqushConnInstance) CheckUserStatus(req *UserStatusQuery) *Result
- func (self *UniqushConnInstance) Forward(req *ForwardRequest) *Result
- func (self *UniqushConnInstance) Id() string
- func (self *UniqushConnInstance) Redirect(req *RedirectRequest) *Result
- func (self *UniqushConnInstance) Send(req *SendRequest) *Result
- type UniqushConnPeer
- type UserStatusQuery
Constants ¶
View Source
const ( SEND_MESSAGE_PATH = "/send.json" FORWARD_MESSAGE_PATH = "/fwd.json" REDIRECT_CLIENT_PATH = "/redir.json" USER_STATUS_QUERY_PATH = "/user-status.json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnResult ¶
type ForwardRequest ¶
type ForwardRequest struct { NeverDigest bool `json:"never-digest,omitempty"` DontPropagate bool `json:"dont-propagate,omitempty"` DontPush bool `json:"dont-push,omitempty"` DontCache bool `json:"dont-cache,omitempty"` DontAsk bool `json:"dont-ask-permission,omitempty"` Receivers []string `json:"receivers"` ReceiverService string `json:"receiver-service"` TTL time.Duration `json:"ttl"` MessageContainer }
type Message ¶
type MessageContainer ¶
type MessageContainer struct { Message *Message `json:"msg"` Id string `json:"id,omitempty"` Sender string `json:"s,omitempty"` SenderService string `json:"ss,omitempty"` Birthday time.Time `json:"b,omitempty"` }
MessageContainer is used to represent a message inside the program. It has meta-data about a message like: the message id, the sender and the service of the sender.
func (*MessageContainer) Eq ¶
func (a *MessageContainer) Eq(b *MessageContainer) bool
func (*MessageContainer) FromServer ¶
func (self *MessageContainer) FromServer() bool
func (*MessageContainer) FromUser ¶
func (self *MessageContainer) FromUser() bool
type MultiPeer ¶
type MultiPeer struct {
// contains filtered or unexported fields
}
func NewMultiPeer ¶
func NewMultiPeer(peers ...UniqushConnPeer) *MultiPeer
func (*MultiPeer) AddPeer ¶
func (self *MultiPeer) AddPeer(p UniqushConnPeer)
func (*MultiPeer) CheckUserStatus ¶
func (self *MultiPeer) CheckUserStatus(req *UserStatusQuery) *Result
func (*MultiPeer) Forward ¶
func (self *MultiPeer) Forward(req *ForwardRequest) *Result
func (*MultiPeer) Redirect ¶
func (self *MultiPeer) Redirect(req *RedirectRequest) *Result
func (*MultiPeer) Send ¶
func (self *MultiPeer) Send(req *SendRequest) *Result
type RedirectRequest ¶
type Result ¶
type Result struct { Error string `json:"error,omitempty"` Results []*ConnResult `json:"results,omitempty"` }
func (*Result) NrSuccessForUser ¶
type SendRequest ¶
type SendRequest struct { NeverDigest bool `json:"never-digest,omitempty"` DontPropagate bool `json:"dont-propagate,omitempty"` DontCache bool `json:"dont-cache,omitempty"` DontPush bool `json:"dont-push,omitempty"` Receivers []string `json:"receivers"` ReceiverService string `json:"receiver-service"` TTL time.Duration `json:"ttl"` Id string `json:"id,omitempty"` PushInfo map[string]string `json:"extra-push-info,omitempty"` Message *Message `json:"msg"` }
type SubscribeRequest ¶
type UniqushConnInstance ¶
type UniqushConnInstance struct { Addr string `json:"addr"` Timeout time.Duration `json:"timeout,omitempty"` }
func NewUniqushConnInstance ¶
func (*UniqushConnInstance) CheckUserStatus ¶
func (self *UniqushConnInstance) CheckUserStatus(req *UserStatusQuery) *Result
func (*UniqushConnInstance) Forward ¶
func (self *UniqushConnInstance) Forward(req *ForwardRequest) *Result
func (*UniqushConnInstance) Id ¶
func (self *UniqushConnInstance) Id() string
func (*UniqushConnInstance) Redirect ¶
func (self *UniqushConnInstance) Redirect(req *RedirectRequest) *Result
func (*UniqushConnInstance) Send ¶
func (self *UniqushConnInstance) Send(req *SendRequest) *Result
type UniqushConnPeer ¶
type UniqushConnPeer interface { Send(req *SendRequest) *Result Forward(req *ForwardRequest) *Result Redirect(req *RedirectRequest) *Result CheckUserStatus(req *UserStatusQuery) *Result Id() string }
type UserStatusQuery ¶
Click to show internal directories.
Click to hide internal directories.