util

package
v0.0.0-...-3bd49d4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package util contains a range of utility code. This code should probably be put into a library to be shared between applications at some point.

Package util - contains a collection of different functions used across all Retrieval Getaways instances.

Utility function like ones to work with time, process lifetime and binary versioning.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetMockedClock

func SetMockedClock(fakeTime int64)

SetMockedClock sets a fake timer

func SetRealClock

func SetRealClock()

SetRealClock ensures the real clock is in use

func SetUpCtrlCExit

func SetUpCtrlCExit(gracefulExit func())

SetUpCtrlCExit - configure the program such that when Control-C is hit, gracefulExit is called, followed by program exit.

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock allows the time.Now to be mocked out for testing

func GetTimeImpl

func GetTimeImpl() Clock

GetTimeImpl returns the implementation of clock to use.

type VersionInfo

type VersionInfo struct {
	Version   string
	BuildDate string
}

VersionInfo holds the version information for the applicaiton.

func GetVersion

func GetVersion() VersionInfo

GetVersion returns the static build information.

Directories

Path Synopsis
Package settings - holds configuration specific to a Retrieval Gateway node.
Package settings - holds configuration specific to a Retrieval Gateway node.

Jump to

Keyboard shortcuts

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