filter

package
v0.9.38 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2015 License: GPL-3.0, LGPL-2.1-or-later Imports: 5 Imported by: 0

Documentation

Overview

Package filter implements event filters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	Compare(Filter) bool
	Trigger(data interface{})
}

type FilterEvent

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

type FilterManager added in v0.8.4

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

func NewFilterManager added in v0.8.4

func NewFilterManager(mux *event.TypeMux) *FilterManager

func (*FilterManager) GetFilter added in v0.8.4

func (self *FilterManager) GetFilter(id int) *core.Filter

GetFilter retrieves a filter installed using InstallFilter. The filter may not be modified.

func (*FilterManager) InstallFilter added in v0.8.4

func (self *FilterManager) InstallFilter(filter *core.Filter) (id int)

func (*FilterManager) Start added in v0.8.4

func (self *FilterManager) Start()

func (*FilterManager) Stop added in v0.8.4

func (self *FilterManager) Stop()

func (*FilterManager) UninstallFilter added in v0.8.4

func (self *FilterManager) UninstallFilter(id int)

type Filters

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

func New

func New() *Filters

func (*Filters) Get added in v0.8.4

func (self *Filters) Get(i int) Filter

func (*Filters) Install

func (self *Filters) Install(watcher Filter) int

func (*Filters) Match added in v0.8.4

func (self *Filters) Match(a, b Filter) bool

func (*Filters) Notify

func (self *Filters) Notify(filter Filter, data interface{})

func (*Filters) Start

func (self *Filters) Start()

func (*Filters) Stop

func (self *Filters) Stop()

func (*Filters) Uninstall

func (self *Filters) Uninstall(id int)

type Generic

type Generic struct {
	Str1, Str2, Str3 string
	Data             map[string]struct{}

	Fn func(data interface{})
}

func (Generic) Compare

func (self Generic) Compare(f Filter) bool

self = registered, f = incoming

func (Generic) Trigger

func (self Generic) Trigger(data interface{})

Jump to

Keyboard shortcuts

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