timemachine

package
v0.0.0-...-e08c3f6 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeHeap

type TimeHeap []TimePoint

func (TimeHeap) Len

func (th TimeHeap) Len() int

func (TimeHeap) Less

func (th TimeHeap) Less(i, j int) bool

func (TimeHeap) Peek

func (th TimeHeap) Peek() TimePoint

func (*TimeHeap) Pop

func (th *TimeHeap) Pop() interface{}

func (*TimeHeap) Push

func (th *TimeHeap) Push(x interface{})

func (TimeHeap) Swap

func (th TimeHeap) Swap(i, j int)

type TimeMachine

type TimeMachine struct {
	// contains filtered or unexported fields
}
var Machine TimeMachine

func (*TimeMachine) AddTimePoint

func (tm *TimeMachine) AddTimePoint(tp TimePoint)

func (*TimeMachine) Init

func (tm *TimeMachine) Init()

func (*TimeMachine) Start

func (tm *TimeMachine) Start()

func (*TimeMachine) Stop

func (tm *TimeMachine) Stop()

type TimePoint

type TimePoint struct {
	Point       time.Time     // the point in time when the Action should be triggered
	WaitTime    time.Duration // the effective waiting time
	IsRepetable func() bool   // should determine if the action should be repeated
	Action      func()        // the logic that should be done when the point in time is triggered
}

Jump to

Keyboard shortcuts

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