Documentation ¶
Overview ¶
The client/session package handles the minutiae of interacting with the Ubuntu Push Notifications server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientSession ¶
type ClientSession struct { // configuration DeviceId string ServerAddr string ExchangeTimeout time.Duration Levels levelmap.LevelMap Protocolator func(net.Conn) protocol.Protocol // connection Connection net.Conn Log logger.Logger TLS *tls.Config ErrCh chan error MsgCh chan *Notification // contains filtered or unexported fields }
ClienSession holds a client<->server session and its configuration.
func NewSession ¶
func (*ClientSession) AutoRedial ¶
func (sess *ClientSession) AutoRedial(doneCh chan uint32)
func (*ClientSession) Close ¶
func (sess *ClientSession) Close()
func (*ClientSession) Dial ¶
func (sess *ClientSession) Dial() error
Dial takes the session from newly created (or newly disconnected) to running the main loop.
func (*ClientSession) Jitter ¶
func (sess *ClientSession) Jitter(spread time.Duration) time.Duration
This Jitter returns a random time.Duration somewhere in [-spread, spread].
func (*ClientSession) State ¶
func (sess *ClientSession) State() ClientSessionState
type ClientSessionState ¶
type ClientSessionState uint32
ClientSessionState is a way to broadly track the progress of the session
const ( Error ClientSessionState = iota Disconnected Connected Started Running )
type Notification ¶
type Notification struct { }
Click to show internal directories.
Click to hide internal directories.