util

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DerefInt16 added in v1.0.0

func DerefInt16(v *int16) int16

func DerefInt64 added in v1.0.0

func DerefInt64(v *int64) int64

func DerefString added in v1.0.0

func DerefString(s *string) string

func DerefTime added in v1.0.0

func DerefTime(t *time.Time) int64

func DerefUint32 added in v1.0.0

func DerefUint32(v *uint32) uint32

func DirsExist added in v0.5.0

func DirsExist(dirs []string) error

func DurationSec added in v1.0.0

func DurationSec(durationSec interface{}) time.Duration

func FileExists added in v1.0.0

func FileExists(path string) bool

func GenerateNATSAuthJWT added in v1.11.0

func GenerateNATSAuthJWT(creds string) ([]nats.Option, error)

GenerateNATSAuthJWT accepts either a path to a .creds file containing JWT credentials or the credentials directly in string format, and returns the correct nats connection authentication options

func GenerateNATSAuthNKey added in v1.11.0

func GenerateNATSAuthNKey(nkeyPath string) ([]nats.Option, error)

GenerateNATSAuthNKey accepts either a path to a file containing a Nkey seed, or the Nkey seed directly in string format, and returns the correct nats connection authentication options

func GenerateTLSConfig added in v1.5.1

func GenerateTLSConfig(caCert, clientCert, clientKey string, skipVerify bool, mTLS tls.ClientAuthType) (*tls.Config, error)

func Gunzip

func Gunzip(data []byte) ([]byte, error)

Gunzip decompresses a slice of bytes and returns a slice of decompressed bytes or an error.

func MapInterfaceToString added in v1.0.0

func MapInterfaceToString(input map[string]interface{}) map[string]string

func RandomString added in v1.10.0

func RandomString(n int) string

func WriteError added in v1.0.0

func WriteError(l *logrus.Entry, errorCh chan<- *records.ErrorRecord, err error)

WriteError is a wrapper for logging an error + writing to an error channel. Both the logger and error channel can be nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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