replay

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExtensionName is the name used by Salesforce for its Bayeux extensions
	ExtensionName string = "replay"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Extension

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

Extension represents the structure of the Salesforce Bayeux Message Extension and manages the state

func New

func New() *Extension

New creates a new extension instance

func (*Extension) Incoming

func (e *Extension) Incoming(ms *bayeux.Message)

Incoming attaches any additional metadata to a message

func (*Extension) Outgoing

func (e *Extension) Outgoing(ms *bayeux.Message)

Outgoing attaches any additional metadata to a message

func (*Extension) Registered

func (e *Extension) Registered(extensionName string, client *bayeux.BayeuxClient)

Registered is called after an extension has been successfully registered

func (*Extension) Unregistered

func (e *Extension) Unregistered()

Unregistered is called when an extension is unregistered

type IDStore

type IDStore interface {
	Set(channel string, replayID int)
	Get(channel string) (int, bool)
	Delete(channel string)
	AsMap() map[string]int
}

IDStore stores and manages the channels and replay IDs for a bayeux server that supports the replay extension

type MapStorage

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

MapStorage implements the IDStore interface over a regular map with a RWMutex protecting the access

func NewMapStorage

func NewMapStorage() *MapStorage

NewMapStorage creates a new MapStorage instance

func (*MapStorage) AsMap

func (s *MapStorage) AsMap() map[string]int

AsMap implements the IDStore interface

func (*MapStorage) Delete

func (s *MapStorage) Delete(channel string)

Delete implements the IDStore interface

func (*MapStorage) Get

func (s *MapStorage) Get(channel string) (replayID int, ok bool)

Get implements the IDStore interface

func (*MapStorage) Set

func (s *MapStorage) Set(channel string, replayID int)

Set implements the IDStore interface

Jump to

Keyboard shortcuts

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