utils

package
v0.0.0-...-3185076 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoOrDie

func DoOrDie(err error)

func DoesFileExist

func DoesFileExist(path string) bool

func DumpJSON

func DumpJSON(obj interface{}) string

func IssueRequest

func IssueRequest(client http.Client, spanName string, makeRequest func(ctx context.Context) *http.Request, rootContext context.Context, tracer trace.Tracer) (string, error)

func ParseJson

func ParseJson(obj interface{}, bytes []byte) error

func PrintJSON

func PrintJSON(obj interface{})

func ReadFile

func ReadFile(filename string) (string, error)

ReadFile wraps calls to ioutil.ReadFile, ensuring that errors are wrapped in a stack trace

func ReadFileBytes

func ReadFileBytes(filename string) ([]byte, error)

ReadFileBytes wraps calls to ioutil.ReadFile, ensuring that errors are wrapped in a stack trace

func ReadJsonFromFile

func ReadJsonFromFile(obj interface{}, path string) error

func RecordEvent

func RecordEvent(name string, err error)

func RecordEventDuration

func RecordEventDuration(name string, code int, start time.Time)

func RunOperation

func RunOperation(tracer trace.Tracer, ctx context.Context, spanName string, action func(span trace.Span) error, opts ...trace.SpanStartOption)

func SetUpLogger

func SetUpLogger(logLevelStr string) error

func SetUpTracerProvider

func SetUpTracerProvider(aggregatorURL string, service string) (*tracesdk.TracerProvider, error)

func WriteFile

func WriteFile(filename string, contents string, perm fs.FileMode) error

WriteFile wraps calls to ioutil.WriteFile, ensuring that errors are wrapped in a stack trace

func WriteJsonToFile

func WriteJsonToFile(obj interface{}, path string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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