utils

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestIdHeader = "X-B3-TraceId"

Functions

func EnsureDir

func EnsureDir(dir string, mode os.FileMode) error

func ExpandPath

func ExpandPath(p string) string

func FileExists

func FileExists(filename string) bool

func HomeDir

func HomeDir() string

func NewRand added in v1.4.2

func NewRand(seed int64) *rand.Rand

NewRand returns a rand.Rand that is threadsafe.

func PathExists

func PathExists(path string) (bool, error)

func ReadFileData

func ReadFileData(str string) ([]byte, error)

Types

type TraceID added in v1.4.2

type TraceID struct {
	High, Low uint64
}

func NewTraceId added in v1.4.2

func NewTraceId(timestamp time.Time) TraceID

func TraceIDFromString added in v1.4.2

func TraceIDFromString(s string) (TraceID, error)

TraceIDFromString creates a TraceID from a hexadecimal string

func (TraceID) String added in v1.4.2

func (t TraceID) String() string

func (TraceID) Timestamp added in v1.4.2

func (id TraceID) Timestamp() time.Time

Timestamp extracts the time part of the TraceID.

Jump to

Keyboard shortcuts

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