diff options
Diffstat (limited to '')
| -rw-r--r-- | opts.go | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,26 @@ +package eventbus + +type Opt interface { + Apply(b *bus) +} + +type NameSeparator string + +func (n NameSeparator) Apply(b *bus) { + b.nameSeparator = string(n) +} + +type Wildcard string + +func (w Wildcard) Apply(b *bus) { + b.wildcard = string(w) +} + +type Capacity int + +func (c Capacity) Apply(b *bus) { + b.listeners = node[Listener]{ + children: make(map[string]*node[Listener], c), + values: make([]Listener, 0, c), + } +} |
