session

package
v0.0.0-...-b2761b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2014 License: GPL-3.0, GPL-3.0 Imports: 12 Imported by: 0

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 NewSession(serverAddr string, pem []byte, exchangeTimeout time.Duration,
	deviceId string, log logger.Logger) (*ClientSession, error)

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 {
}

Directories

Path Synopsis
levelmap holds an implementation of the LevelMap that the client session uses to keep track of what messages it has seen.
levelmap holds an implementation of the LevelMap that the client session uses to keep track of what messages it has seen.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL