util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPatch

func BuildPatch(op string, path string, obj interface{}) (jsonpatch.Patch, error)

func Debugf

func Debugf(format string, args ...interface{}) (int, error)

func Time

func Time(name string)

Time allows code which doesn't want to deal with timing explicitly to nonetheless allow timing events if the calling code requests. It uses a hidden global reference to the last explicitly Start()ed Timing.

Types

type RepositoryInfo

type RepositoryInfo struct {
	Path       string
	Repository *git.Repository
}

func GetRepository

func GetRepository(pathWithinRepository string) (*RepositoryInfo, error)

type Timing

type Timing interface {
	Start(name string) Timing
	Finish()
	Print()
}

Timing allows measuring time spent in code. Each Start() starts a new step and returns a Timing which can be used in turn to measure substeps. Last started Timing is also available to timing-ignorant code through util.Time().

func NewTiming

func NewTiming(name string) Timing

NewTiming makes a new top-level Timing.

Jump to

Keyboard shortcuts

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