timeutils

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package idutils provides a set of helper functions to convert ids.

Functions in big_endian_converter.go help converting uint64 ids to TraceID and SpanID using big endian, and vice versa.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PolicyTicker

type PolicyTicker struct {
	Ticker     *time.Ticker
	OnTickFunc func()
	StopCh     chan struct{}
}

Implements TTicker and abstracts underlying time ticker's functionality to make usage simpler.

func (*PolicyTicker) OnTick

func (pt *PolicyTicker) OnTick()

func (*PolicyTicker) Start

func (pt *PolicyTicker) Start(d time.Duration)

func (*PolicyTicker) Stop

func (pt *PolicyTicker) Stop()

type TTicker

type TTicker interface {
	// start sets the frequency of the Ticker and starts the periodic calls to OnTick.
	Start(d time.Duration)
	// OnTick is called when the Ticker fires.
	OnTick()
	// Stop firing the Ticker.
	Stop()
}

TTicker interface allows easier testing of Ticker related functionality

Jump to

Keyboard shortcuts

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