util

package
v0.0.0-...-72594fe Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2014 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

Contains various utility functions.

Index

Constants

This section is empty.

Variables

View Source
var Prof = Profiler{/* contains filtered or unexported fields */}

Functions

func Diff

func Diff(a, b string) string

func PascalCaseToSnakeCase

func PascalCaseToSnakeCase(in string) string

Types

type Op

type Op int

A comparison operation used in context queries.

const (
	OpEqual            Op = iota //< Compare for equality.
	OpNotEqual                   //< Compare for difference.
	OpRegexMatch                 //< Compare for a regular expression match.
	OpNotRegexMatch              //< Compare for a regular expression difference.
	OpRegexContains              //< Compare whether the given regular expression matches some substring of the operand.
	OpNotRegexContains           //< Compare whether the given regular expression does not match some substring of the operand.
)

func (*Op) UnmarshalJSON

func (o *Op) UnmarshalJSON(d []byte) error

type ProfToken

type ProfToken struct {
	Name string
	// contains filtered or unexported fields
}

func (*ProfToken) Exit

func (pt *ProfToken) Exit()

type ProfileEntry

type ProfileEntry struct {
	Calls   int
	Tottime time.Duration
}

type ProfileResult

type ProfileResult struct {
	Name string
	ProfileEntry
}

func (*ProfileResult) Avg

func (v *ProfileResult) Avg() time.Duration

func (ProfileResult) String

func (v ProfileResult) String() string

type Profiler

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

func (*Profiler) Enter

func (p *Profiler) Enter(name string) ProfToken

func (*Profiler) Results

func (p *Profiler) Results() (ret []ProfileResult)

func (*Profiler) SortByAvgTime

func (p *Profiler) SortByAvgTime() []ProfileResult

func (*Profiler) SortByName

func (p *Profiler) SortByName() []ProfileResult

func (*Profiler) SortByTotalTime

func (p *Profiler) SortByTotalTime() []ProfileResult

func (Profiler) String

func (p Profiler) String() (ret string)

Jump to

Keyboard shortcuts

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