plugins

package
v0.0.0-...-2b98a61 Latest Latest
Warning

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

Go to latest
Published: May 17, 2014 License: EPL-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSubAllPlugins

func DeleteSubAllPlugins(client *Client)

when a client disconnects and is cleansession true we want to remove all subscriptions that client held in all plugins.

func ReadPluginConfig

func ReadPluginConfig(confFile string, result interface{}) error

func StartPlugins

func StartPlugins()

Types

type Plugin

type Plugin interface {
	Initialise() error
	AddSub(*Client, []string, byte, chan byte)
	DeleteSub(*Client, []string, chan bool)
}

define the interface for a Plugin, any struct with these methods can be a plugin

type RedirectPlugin

type RedirectPlugin struct {
	sync.RWMutex
	Redirects map[string]string
	// contains filtered or unexported fields
}

func (*RedirectPlugin) AddSub

func (rp *RedirectPlugin) AddSub(client *Client, topic []string, qos byte, complete chan byte)

func (*RedirectPlugin) DeleteSub

func (rp *RedirectPlugin) DeleteSub(client *Client, topic []string, complete chan bool)

func (*RedirectPlugin) Initialise

func (rp *RedirectPlugin) Initialise() error

func (*RedirectPlugin) Run

func (rp *RedirectPlugin) Run()

type Secrets

type Secrets struct {
	ConsumerKey    string `json:"consumerKey,omitempty"`
	ConsumerSecret string `json:"consumerSecret,omitempty"`
	AccessToken    string `json:"accessToken,omitempty"`
	AccessSecret   string `json:"accessSecret,omitempty"`
}

type TwitterPlugin

type TwitterPlugin struct {
	sync.RWMutex

	Subscribed map[*Client]byte
	// contains filtered or unexported fields
}

func (*TwitterPlugin) AddSub

func (tp *TwitterPlugin) AddSub(client *Client, subscription []string, qos byte, complete chan byte)

func (*TwitterPlugin) DeleteSub

func (tp *TwitterPlugin) DeleteSub(client *Client, topic []string, complete chan bool)

func (*TwitterPlugin) Initialise

func (tp *TwitterPlugin) Initialise() error

func (*TwitterPlugin) Run

func (tp *TwitterPlugin) Run()

Jump to

Keyboard shortcuts

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