tipmanager

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 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 events happening on the TipManager.

type TipManager

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

TipManager manages liked tips and emits events for their removal and addition.

func New

func New() *TipManager

New creates a new TipManager.

func (*TipManager) AddTip

func (t *TipManager) AddTip(valueObject *payload.Payload)

AddTip adds the given value object as a tip.

func (*TipManager) AllTips added in v0.2.4

func (t *TipManager) AllTips() (tips []payload.ID)

AllTips returns all the tips.

func (*TipManager) RemoveTip

func (t *TipManager) RemoveTip(valueObject *payload.Payload)

RemoveTip removes the given value object as a tip.

func (*TipManager) Size

func (t *TipManager) Size() int

Size returns the total liked tips.

func (*TipManager) Tips

func (t *TipManager) Tips() (parent1ObjectID, parent2ObjectID payload.ID)

Tips returns two randomly selected tips.

Jump to

Keyboard shortcuts

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