common

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug   *log.Logger
	Info    *log.Logger
	Warning *log.Logger
	Error   *log.Logger
)

Functions

func Assert added in v0.11.0

func Assert(test bool)

Assert test is true, panic otherwise

func CheckFatal added in v0.10.0

func CheckFatal(e error)

func CheckWarn added in v0.10.0

func CheckWarn(e error)

func InitDefaultLogging

func InitDefaultLogging(debug bool)

func InitLogging

func InitLogging(debugHandle io.Writer,
	infoHandle io.Writer,
	warningHandle io.Writer,
	errorHandle io.Writer)

func OnOff added in v1.0.0

func OnOff(b bool) string

func SignalHandlerLoop added in v0.11.0

func SignalHandlerLoop(ss ...SignalReceiver)

Types

type SchedQueue added in v1.0.0

type SchedQueue struct {
	// contains filtered or unexported fields
}

SchedQueue is queue of scheduled callables

func NewSchedQueue added in v1.0.0

func NewSchedQueue(clock clock.Clock) *SchedQueue

NewSchedQueue creates a new scheduled queue

func (*SchedQueue) Add added in v1.0.0

func (cq *SchedQueue) Add(c callable, t time.Time)

Add schedules a call. The callable should not modify the scheduled queue in any way.

func (*SchedQueue) Count added in v1.0.0

func (cq *SchedQueue) Count() uint64

Counter returns the number of calls invoked in the queued Note: the result will wrap over time.

func (*SchedQueue) Flush added in v1.0.0

func (cq *SchedQueue) Flush()

ensure that the background goroutine has executed any pending callbacks

func (*SchedQueue) Start added in v1.0.0

func (cq *SchedQueue) Start()

Start starts the scheduled queue

func (*SchedQueue) Stop added in v1.0.0

func (cq *SchedQueue) Stop()

Stop stops the scheduled queue

type SignalReceiver added in v0.11.0

type SignalReceiver interface {
	Stop() error
	Status() string
}

A subsystem/server/... that can be stopped or queried about the status with a signal

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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