utils

package
v0.0.0-...-d9b5379 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanPath

func CleanPath(path string) string

func FromPbJson

func FromPbJson[T proto.Message](reader io.Reader, obj T) error

func Introspect

func Introspect(v interface{}) string

Serialize an interface using JSON or return error string

func InvokeWithRetry

func InvokeWithRetry(config RetryConfig, f RetriableFunc) error

func IsEmptyString

func IsEmptyString(s string) bool

func MapStruct

func MapStruct[T any](source interface{}, dest *T) error

func NewUniqueId

func NewUniqueId() string

func SafelyGetValue

func SafelyGetValue[T any](target *T) T

func TlsConfigFromEnvironment

func TlsConfigFromEnvironment(serverName string) (tls.Config, error)

func ToPbJson

func ToPbJson[T proto.Message](obj T, indent string) (string, error)

Types

type RetriableFunc

type RetriableFunc func(retryN int) error

type RetryConfig

type RetryConfig struct {
	Count int
	Sleep time.Duration
}

Jump to

Keyboard shortcuts

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