push

package
v0.0.0-...-aa8d278 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBadDeliveryPoint

func NewBadDeliveryPoint(dp *DeliveryPoint) error

func NewBadDeliveryPointWithDetails

func NewBadDeliveryPointWithDetails(dp *DeliveryPoint, details string) error

func NewBadNotification

func NewBadNotification() error

func NewBadNotificationWithDetails

func NewBadNotificationWithDetails(details string) error

func NewBadPushServiceProvider

func NewBadPushServiceProvider(psp *PushServiceProvider) error

func NewBadPushServiceProviderWithDetails

func NewBadPushServiceProviderWithDetails(psp *PushServiceProvider, details string) error

func NewConnectionError

func NewConnectionError(err error) error

func NewDeliveryPointUpdate

func NewDeliveryPointUpdate(dp *DeliveryPoint) error

func NewIncompatibleError

func NewIncompatibleError() error

func NewPushServiceProviderUpdate

func NewPushServiceProviderUpdate(psp *PushServiceProvider) error

func NewRetryError

func NewRetryError(psp *PushServiceProvider, dp *DeliveryPoint, notif *Notification, after time.Duration) error

func NewRetryErrorWithReason

func NewRetryErrorWithReason(psp *PushServiceProvider, dp *DeliveryPoint, notif *Notification, after time.Duration, reason error) error

func NewUnsubscribeUpdate

func NewUnsubscribeUpdate(psp *PushServiceProvider, dp *DeliveryPoint) error

Types

type BadDeliveryPoint

type BadDeliveryPoint struct {
	Destination *DeliveryPoint
	Details     string
}

func (*BadDeliveryPoint) Error

func (e *BadDeliveryPoint) Error() string

type BadNotification

type BadNotification struct {
	Details string
}

func (*BadNotification) Error

func (e *BadNotification) Error() string

type BadPushServiceProvider

type BadPushServiceProvider struct {
	Provider *PushServiceProvider
	Details  string
}

func (*BadPushServiceProvider) Error

func (e *BadPushServiceProvider) Error() string

type ConnectionError

type ConnectionError struct {
	Err error
}

func (*ConnectionError) Error

func (e *ConnectionError) Error() string

type DeliveryPoint

type DeliveryPoint struct {
	PushPeer
}

func NewEmptyDeliveryPoint

func NewEmptyDeliveryPoint() *DeliveryPoint

type DeliveryPointUpdate

type DeliveryPointUpdate struct {
	Destination *DeliveryPoint
}

func (*DeliveryPointUpdate) Error

func (e *DeliveryPointUpdate) Error() string

type IncompatibleError

type IncompatibleError struct {
}

func (*IncompatibleError) Error

func (e *IncompatibleError) Error() string

type InfoReport

type InfoReport struct {
	// contains filtered or unexported fields
}

This is not an actual error. But it is worthy to be reported to the user.

func NewInfo

func NewInfo(msg string) *InfoReport

func NewInfof

func NewInfof(f string, v ...interface{}) *InfoReport

func (*InfoReport) Error

func (e *InfoReport) Error() string

type Notification

type Notification struct {
	Data map[string]string
}

func NewEmptyNotification

func NewEmptyNotification() *Notification

func (*Notification) Clone

func (n *Notification) Clone() *Notification

func (*Notification) IsEmpty

func (n *Notification) IsEmpty() bool

func (*Notification) String

func (self *Notification) String() string

type PushPeer

type PushPeer struct {
	VolatileData map[string]string
	FixedData    map[string]string
	// contains filtered or unexported fields
}

func (*PushPeer) InitPushPeer

func (p *PushPeer) InitPushPeer()

func (*PushPeer) Marshal

func (p *PushPeer) Marshal() []byte

func (*PushPeer) Name

func (p *PushPeer) Name() string

func (*PushPeer) PushServiceName

func (p *PushPeer) PushServiceName() string

func (*PushPeer) String

func (p *PushPeer) String() string

func (*PushPeer) Unmarshal

func (p *PushPeer) Unmarshal(value []byte) error

type PushResult

type PushResult struct {
	Provider    *PushServiceProvider
	Destination *DeliveryPoint
	Content     *Notification
	MsgId       string
	Err         error
}

func (*PushResult) Error

func (r *PushResult) Error() string

func (*PushResult) IsError

func (r *PushResult) IsError() bool

type PushServiceManager

type PushServiceManager struct {
	// contains filtered or unexported fields
}

func GetPushServiceManager

func GetPushServiceManager() *PushServiceManager

func (*PushServiceManager) BuildDeliveryPointFromBytes

func (m *PushServiceManager) BuildDeliveryPointFromBytes(value []byte) (dp *DeliveryPoint, err error)

func (*PushServiceManager) BuildDeliveryPointFromMap

func (m *PushServiceManager) BuildDeliveryPointFromMap(kv map[string]string) (dp *DeliveryPoint, err error)

func (*PushServiceManager) BuildPushServiceProviderFromBytes

func (m *PushServiceManager) BuildPushServiceProviderFromBytes(value []byte) (psp *PushServiceProvider, err error)

func (*PushServiceManager) BuildPushServiceProviderFromMap

func (m *PushServiceManager) BuildPushServiceProviderFromMap(kv map[string]string) (psp *PushServiceProvider, err error)

func (*PushServiceManager) Finalize

func (m *PushServiceManager) Finalize()

func (*PushServiceManager) Push

func (m *PushServiceManager) Push(psp *PushServiceProvider, dpQueue <-chan *DeliveryPoint, resQueue chan<- *PushResult, notif *Notification)

func (*PushServiceManager) RegisterPushServiceType

func (m *PushServiceManager) RegisterPushServiceType(pt PushServiceType) error

func (*PushServiceManager) SetErrorReportChan

func (m *PushServiceManager) SetErrorReportChan(errChan chan<- error)

type PushServiceProvider

type PushServiceProvider struct {
	PushPeer
}

func NewEmptyPushServiceProvider

func NewEmptyPushServiceProvider() *PushServiceProvider

type PushServiceProviderUpdate

type PushServiceProviderUpdate struct {
	Provider *PushServiceProvider
}

func (*PushServiceProviderUpdate) Error

func (e *PushServiceProviderUpdate) Error() string

type PushServiceType

type PushServiceType interface {

	// Passing a pointer to PushServiceProvider allows us
	// to use a memory pool to store a set of empty *PushServiceProvider
	BuildPushServiceProviderFromMap(map[string]string, *PushServiceProvider) error

	BuildDeliveryPointFromMap(map[string]string, *DeliveryPoint) error
	Name() string

	// NOTE: This method should always be run in a separate goroutine.
	// The implementation of this method should return only
	// if it finished all push request.
	//
	// Once this method returns, it cannot use the second channel
	// to report error. (For example, it cannot fork a new goroutine
	// and use this channel in this goroutine after the function returns.)
	//
	// Any implementation MUST close the second channel (chan<- *PushResult)
	// once the works done.
	Push(*PushServiceProvider, <-chan *DeliveryPoint, chan<- *PushResult, *Notification)

	// Set a channel for the push service provider so that it can report error even if
	// there is no method call on it.
	SetErrorReportChan(errChan chan<- error)

	Finalize()
}

type RetryError

type RetryError struct {
	After       time.Duration
	Provider    *PushServiceProvider
	Destination *DeliveryPoint
	Content     *Notification
	Reason      error
}

func (*RetryError) Error

func (e *RetryError) Error() string

type UnsubscribeUpdate

type UnsubscribeUpdate struct {
	Provider    *PushServiceProvider
	Destination *DeliveryPoint
}

func (*UnsubscribeUpdate) Error

func (e *UnsubscribeUpdate) Error() string

Jump to

Keyboard shortcuts

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