tipselector

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: Apache-2.0, BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Events

type Events struct {
	// Fired when a tip is added.
	TipAdded *events.Event
	// Fired when a tip is removed.
	TipRemoved *events.Event
}

Events represents event happening on the tip-selector.

type TipSelector

type TipSelector struct {
	Events Events
	// contains filtered or unexported fields
}

TipSelector manages a map of tips and emits events for their removal and addition.

func New

func New(tips ...message.Id) *TipSelector

New creates a new tip-selector.

func (*TipSelector) AddTip

func (tipSelector *TipSelector) AddTip(msg *message.Message)

AddTip adds the given message as a tip.

func (*TipSelector) Set added in v0.2.2

func (tipSelector *TipSelector) Set(tips ...message.Id)

Set adds the given messageIDs as tips.

func (*TipSelector) TipCount

func (tipSelector *TipSelector) TipCount() int

TipCount the amount of current tips.

func (*TipSelector) Tips

func (tipSelector *TipSelector) Tips() (trunkMessageId, branchMessageId message.Id)

Tips returns two tips.

Jump to

Keyboard shortcuts

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