unittest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2021 License: NCSA Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDemoSignal4

func NewDemoSignal4() *demoSignal4

Connect a new listener to DemoSignal4.

Types

type DemoSignal1

type DemoSignal1 struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

DemoSignal1 illustrates a standard untyped signal.

func NewDemoSignal1

func NewDemoSignal1() *DemoSignal1

NewDemoSignal1 creates a new instance of DemoSignal1 for signal handling.

func (*DemoSignal1) Connect

func (s *DemoSignal1) Connect(fn func(string))

func (*DemoSignal1) Disconnect

func (s *DemoSignal1) Disconnect(key int64) (ok bool)

func (*DemoSignal1) OnDisconnect

func (s *DemoSignal1) OnDisconnect(key int64, fn func())

func (*DemoSignal1) Send

func (s *DemoSignal1) Send(fn func(func(string)))

Send data to all listeners registered to the signal.

func (*DemoSignal1) WithDisconnector

func (s *DemoSignal1) WithDisconnector(fn func(string)) int64

type DemoSignal2

type DemoSignal2 struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

DemoSignal2 illustrates a typed signal.

func NewDemoSignal2

func NewDemoSignal2() *DemoSignal2

Connect a new listener to DemoSignal2.

func (*DemoSignal2) Connect

func (s *DemoSignal2) Connect(fn DemoSignal2Func)

func (*DemoSignal2) Disconnect

func (s *DemoSignal2) Disconnect(key int64) (ok bool)

func (*DemoSignal2) OnDisconnect

func (s *DemoSignal2) OnDisconnect(key int64, fn func())

func (*DemoSignal2) Send

func (s *DemoSignal2) Send(fn func(DemoSignal2Func))

Send data to all listeners registered to the signal.

func (*DemoSignal2) WithDisconnector

func (s *DemoSignal2) WithDisconnector(fn DemoSignal2Func) int64

type DemoSignal2Func

type DemoSignal2Func func(int, string, string)

DemoSignal2Func is the auto-generated type for DemoSignal2.

All .Connect() calls internally cast functions to this type.

type DemoSignal3

type DemoSignal3 struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

DemoSignal3 illustrates a signal with a return value.

func NewDemoSignal3

func NewDemoSignal3() *DemoSignal3

NewDemoSignal3 creates a new instance of DemoSignal3 for signal handling.

func (*DemoSignal3) Connect

func (s *DemoSignal3) Connect(fn func(string) string)

func (*DemoSignal3) Disconnect

func (s *DemoSignal3) Disconnect(key int64) (ok bool)

func (*DemoSignal3) OnDisconnect

func (s *DemoSignal3) OnDisconnect(key int64, fn func())

func (*DemoSignal3) Send

func (s *DemoSignal3) Send(fn func(func(string) string))

Send data to all listeners registered to the signal.

func (*DemoSignal3) WithDisconnector

func (s *DemoSignal3) WithDisconnector(fn func(string) string) int64

type DemoSignal4Func

type DemoSignal4Func func(int)

DemoSignal4Func is the auto-generated type for DemoSignal4.

All .Connect() calls internally cast functions to this type.

Jump to

Keyboard shortcuts

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