utils

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: LGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package utils provides utilities functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToYN

func BoolToYN(b bool) string

BoolToYN converts a boolean to "yes" or "no".

func ErrorfOrEmpty

func ErrorfOrEmpty(msg string, err error) string

ErrorfOrEmpty returns a message if the error is not nil.

func FormatErrorfOrEmpty

func FormatErrorfOrEmpty(format string, err error, va ...any) string

FormatErrorfOrEmpty returns a formatted message if the error is not nil.

func FormatLabels

func FormatLabels(labels []metaschedulerabi.Label) []string

FormatLabels formats labels into a slice of "key: value".

func GetPrivateKey added in v1.4.0

func GetPrivateKey(ethHexPK, orPath string) (*ecdsa.PrivateKey, error)

GetPrivateKey fetch or generates an ethereum private key.

func StringsToLabels

func StringsToLabels(input string) ([]types.Label, error)

StringsToLabels converts a "key=value,key2=value2" into a slice of labels.

func YNToBool

func YNToBool(b string) bool

YNToBool converts a yes/no to bool. Defaults to "no" on failure.

Types

This section is empty.

Jump to

Keyboard shortcuts

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