cgoemitter: github.com/supermock/cgoemitter Index | Files | Directories

package cgoemitter

import "github.com/supermock/cgoemitter"

Index

Package Files

arguments.go cgoemitter.go events.go listeners.go

Variables

var (
    //ErrUnknownEvent | This event does not exist
    ErrUnknownEvent = errors.New("This event does not exist")
)

func Off Uses

func Off(eventName string, listener *ListenerFunc)

Off | Removes a listener from the event or the event itself if the listener number equals zero

func On Uses

func On(eventName string, listener *ListenerFunc)

On | Adds a new event if it does not exist, and also adds a new listener

func Once Uses

func Once(eventName string, listener *ListenerFunc)

Once | Adds a new event if it does not exist, and also adds a new listener with only one execution

type Arguments Uses

type Arguments []unsafe.Pointer

Arguments | Custom arguments received from C language

func (Arguments) Arg Uses

func (args Arguments) Arg(index int) unsafe.Pointer

Arg | Get the index argument

func (Arguments) Count Uses

func (args Arguments) Count() int

Count | Returns the number of arguments

func (Arguments) Double Uses

func (args Arguments) Double(index int) float64

Double | Converts the received pointer to the float64 type

func (Arguments) Float Uses

func (args Arguments) Float(index int) float32

Float | Converts the received pointer to the float32 type

func (Arguments) Int Uses

func (args Arguments) Int(index int) int

Int | Converts the received pointer to integer type

func (Arguments) String Uses

func (args Arguments) String(index int) string

String | Converts the received pointer to string type

type Events Uses

type Events map[string]*Listeners

Events | List of events

func (*Events) AddEvent Uses

func (events *Events) AddEvent(eventName string) *Listeners

AddEvent | Add a new event

func (Events) Has Uses

func (events Events) Has(eventName string) (*Listeners, bool)

Has | Returns the value and if the event already exists it returns true

func (*Events) RemoveEvent Uses

func (events *Events) RemoveEvent(eventName string)

RemoveEvent | Remove an event

type ListenerFunc Uses

type ListenerFunc func(Arguments)

ListenerFunc | Listener function

func NewListener Uses

func NewListener(listener ListenerFunc) *ListenerFunc

NewListener | Instance a new listener

type Listeners Uses

type Listeners []*ListenerFunc

Listeners | List of listeners

func GetListeners Uses

func GetListeners(eventName string) (Listeners, error)

GetListeners | Return all listeners for an event

func (*Listeners) AddListener Uses

func (listeners *Listeners) AddListener(listener *ListenerFunc)

AddListener | Adds a new listener

func (*Listeners) RemoveListener Uses

func (listeners *Listeners) RemoveListener(listener *ListenerFunc)

RemoveListener | Remove a listener

Directories

PathSynopsis
parser

Package cgoemitter imports 6 packages (graph). Updated 2018-05-15. Refresh now. Tools for package owners.