Versions in this module Expand all Collapse all v0 v0.5.0 Jun 23, 2023 v0.4.0 Jun 22, 2023 v0.3.0 Jun 22, 2023 v0.2.0 Jun 22, 2023 Changes in this version + const DefaultSecretSize + const EVMWordByteLen + const FastN + const FastP + const FormatBool + const FormatBytes + const FormatInt256 + const FormatPreformatted + const FormatUint256 + const GB + const KB + const MB + const MinRequiredLen + const PasswordComplexityRequirements + const TB + var DefaultScryptParams = ScryptParams + var EmptyHash = common.Hash + var ErrAlreadyStopped = errors.New("already stopped") + var ErrCannotStopUnstarted = errors.New("cannot stop unstarted service") + var ErrEmptyPasswordInFile = errors.New("detected empty password in password file") + var ErrMsgHeader = fmt.Sprintf(..., MinRequiredLen) + var ErrPasswordWhitespace = errors.New("leading/trailing whitespace detected in password") + var ErrWhitespace = errors.New("password contains a leading or trailing whitespace") + var FastScryptParams = ScryptParams + var LeadingWhitespace = regexp.MustCompile(`^\s+`) + var MaxInt256 = &big.Int + var MaxUint256 = &big.Int + var MinInt256 = &big.Int + var TrailingWhitespace = regexp.MustCompile(`\s+$`) + var ZeroAddress = common.Address + func ABIDecode(abiStr string, data []byte) ([]interface{}, error) + func ABIEncode(abiStr string, values ...interface{}) ([]byte, error) + func AddHexPrefix(str string) string + func AllEqual[T comparable](elems ...T) bool + func BatchSplit[T any](list []T, max int) (out [][]T, err error) + func BoxOutput(errorMsgTemplate string, errorMsgValues ...interface{}) string + func Bytes32FromString(s string) [32]byte + func Bytes32ToSlice(a [32]byte) (r []byte) + func Bytes4FromString(s string) [4]byte + func CheckPasswordHash(password, hash string) bool + func CheckUint256(n *big.Int) error + func ConcatBytes(bufs ...[]byte) []byte + func ContextFromChan(chStop <-chan struct{}) (context.Context, context.CancelFunc) + func ContextFromChanWithDeadline(chStop <-chan struct{}, timeout time.Duration) (context.Context, context.CancelFunc) + func DurationFromNow(t time.Time) time.Duration + func EIP55CapitalizedAddress(possibleAddressString string) bool + func EVMBytesToUint64(buf []byte) uint64 + func EVMEncodeBytes(input []byte) []byte + func EVMTranscodeBool(value gjson.Result) ([]byte, error) + func EVMTranscodeInt256(value gjson.Result) ([]byte, error) + func EVMTranscodeUint256(value gjson.Result) ([]byte, error) + func EVMWordBigInt(val *big.Int) ([]byte, error) + func EVMWordSignedBigInt(val *big.Int) ([]byte, error) + func EVMWordUint128(val *big.Int) ([]byte, error) + func EVMWordUint32(val uint32) []byte + func EVMWordUint64(val uint64) []byte + func EnsureClosed(c io.Closer) error + func EnsureDirAndMaxPerms(path string, perms os.FileMode) error + func EnsureFileMaxPerms(file *os.File, perms os.FileMode) error + func EnsureFilepathMaxPerms(filepath string, perms os.FileMode) (err error) + func FileExists(name string) (bool, error) + func FiniteTicker(period time.Duration, onTick func()) func() + func FormatJSON(v interface{}) ([]byte, error) + func HasHexPrefix(str string) bool + func HashPassword(password string) (string, error) + func HexToBig(s string) *big.Int + func HexToUint256(s string) (*big.Int, error) + func ISO8601UTC(t time.Time) string + func IsEmpty(bytes []byte) bool + func IsEmptyAddress(addr common.Address) bool + func IsFileOwnedByChainlink(fileInfo os.FileInfo) (bool, error) + func IsQuoted(input []byte) bool + func JustError(_ interface{}, err error) error + func Keccak256(in []byte) ([]byte, error) + func Keccak256Fixed(in []byte) [32]byte + func LeftPadBitString(input string, length int) string + func MinKey[U any, T constraints.Ordered](elems []U, key func(U) T) T + func MultiErrorList(err error) (int, error) + func MustAbiType(ts string, components []abi.ArgumentMarshaling) abi.Type + func MustHash(in string) common.Hash + func MustNewPeerID() string + func MustUnmarshalToMap(input string) map[string]interface + func NewBytes32ID() string + func NewHash() common.Hash + func NewRedialBackoff() backoff.Backoff + func NewSecret(n int) string + func NormalizedJSON(val []byte) (string, error) + func PadByteToHash(b byte) common.Hash + func ParseEthereumAddress(addressString string) (common.Address, error) + func PasswordFromFile(pwdFile string) (string, error) + func RandUint256() *big.Int + func RandomAddress() common.Address + func RandomBytes32() (r [32]byte) + func RemoveHexPrefix(str string) string + func RemoveQuotes(input []byte) []byte + func RetryWithBackoff(ctx context.Context, fn func() (retry bool)) + func Sha256(in string) (string, error) + func StringToHex(in string) string + func ToDecimal(input interface{}) (decimal.Decimal, error) + func TooPermissive(fileMode, maxAllowedPerms os.FileMode) bool + func TryParseHex(s string) (b []byte, err error) + func Uint256ToBytes(x *big.Int) (uint256 []byte, err error) + func Uint256ToBytes32(n *big.Int) []byte + func UnmarshalToMap(input string) (map[string]interface{}, error) + func ValidateCronSchedule(schedule string) error + func VerifyPasswordComplexity(password string, disallowedStrings ...string) (merr error) + func WaitGroupChan(wg *sync.WaitGroup) <-chan struct + func WithCloseChan(parentCtx context.Context, chStop <-chan struct{}) (ctx context.Context, cancel context.CancelFunc) + func WithJitter(d time.Duration) time.Duration + func WrapIfError(err *error, msg string) + func WriteFileWithMaxPerms(path string, data []byte, perms os.FileMode) (err error) + type BackoffSleeper struct + func NewBackoffSleeper() *BackoffSleeper + func (bs *BackoffSleeper) After() time.Duration + func (bs *BackoffSleeper) Duration() time.Duration + func (bs *BackoffSleeper) Reset() + func (bs *BackoffSleeper) Sleep() + type BackoffTicker struct + C chan time.Time + func NewBackoffTicker(min, max time.Duration) BackoffTicker + func (t *BackoffTicker) Bounds() (time.Duration, time.Duration) + func (t *BackoffTicker) Start() bool + func (t *BackoffTicker) Stop() bool + func (t *BackoffTicker) Ticks() <-chan time.Time + type Big big.Int + func NewBig(i *big.Int) *Big + func NewBigI(i int64) *Big + func (b *Big) Add(c interface{}) *Big + func (b *Big) Bytes() []byte + func (b *Big) Cmp(c *Big) int + func (b *Big) Equal(c *Big) bool + func (b *Big) Hex() string + func (b *Big) Int64() int64 + func (b *Big) Mod(c interface{}) *Big + func (b *Big) Scan(value interface{}) error + func (b *Big) String() string + func (b *Big) Sub(c interface{}) *Big + func (b *Big) ToInt() *big.Int + func (b *Big) UnmarshalJSON(input []byte) error + func (b *Big) UnmarshalText(input []byte) error + func (b Big) MarshalJSON() ([]byte, error) + func (b Big) MarshalText() ([]byte, error) + func (b Big) Value() (driver.Value, error) + type BigFloat big.Float + func (b *BigFloat) UnmarshalJSON(buf []byte) error + func (b *BigFloat) Value() *big.Float + func (b BigFloat) MarshalJSON() ([]byte, error) + type BoundedPriorityQueue struct + func NewBoundedPriorityQueue[T any](capacities map[uint]int) *BoundedPriorityQueue[T] + func (q *BoundedPriorityQueue[T]) Add(priority uint, x T) + func (q *BoundedPriorityQueue[T]) Empty() bool + func (q *BoundedPriorityQueue[T]) Take() (t T) + type BoundedQueue struct + func NewBoundedQueue[T any](capacity int) *BoundedQueue[T] + func (q *BoundedQueue[T]) Add(x T) + func (q *BoundedQueue[T]) Empty() bool + func (q *BoundedQueue[T]) Full() bool + func (q *BoundedQueue[T]) Take() (t T) + type CronTicker struct + func NewCronTicker(schedule string) (CronTicker, error) + func (t *CronTicker) Start() bool + func (t *CronTicker) Stop() bool + func (t *CronTicker) Ticks() <-chan time.Time + type DeferableWriteCloser struct + func NewDeferableWriteCloser(wc io.WriteCloser) *DeferableWriteCloser + func (wc *DeferableWriteCloser) Close() error + type DependentAwaiter interface + AddDependents func(n int) + AwaitDependents func() <-chan struct{} + DependentReady func() + func NewDependentAwaiter() DependentAwaiter + type DiskStatsProvider interface + AvailableSpace func(path string) (FileSize, error) + func NewDiskStatsProvider() DiskStatsProvider + type FileSize uint64 + func (s *FileSize) UnmarshalText(bs []byte) error + func (s FileSize) MarshalText() ([]byte, error) + func (s FileSize) String() string + type KeyedMutex struct + func (m *KeyedMutex) LockInt64(key int64) func() + type LazyLoad struct + func NewLazyLoad[T any](f func() (T, error)) *LazyLoad[T] + func (l *LazyLoad[T]) Get() (out T, err error) + func (l *LazyLoad[T]) Reset() + type Mailbox struct + func NewHighCapacityMailbox[T any]() *Mailbox[T] + func NewMailbox[T any](capacity uint64) *Mailbox[T] + func NewSingleMailbox[T any]() *Mailbox[T] + func (m *Mailbox[T]) Close() error + func (m *Mailbox[T]) Deliver(x T) (wasOverCapacity bool) + func (m *Mailbox[T]) Notify() <-chan struct{} + func (m *Mailbox[T]) Retrieve() (t T, ok bool) + func (m *Mailbox[T]) RetrieveAll() []T + func (m *Mailbox[T]) RetrieveLatestAndClear() (t T) + type MailboxMonitor struct + func NewMailboxMonitor(appID string) *MailboxMonitor + func (m *MailboxMonitor) Close() error + func (m *MailboxMonitor) HealthReport() map[string]error + func (m *MailboxMonitor) Monitor(mb mailbox, name ...string) + func (m *MailboxMonitor) Name() string + func (m *MailboxMonitor) Start(context.Context) error + type PausableTicker struct + func NewPausableTicker(duration time.Duration) PausableTicker + func (t *PausableTicker) Destroy() + func (t *PausableTicker) Pause() + func (t *PausableTicker) Resume() + func (t *PausableTicker) Ticks() <-chan time.Time + type ResettableTimer struct + func NewResettableTimer() ResettableTimer + func (t *ResettableTimer) Reset(duration time.Duration) + func (t *ResettableTimer) Stop() + func (t *ResettableTimer) Ticks() <-chan time.Time + type ScryptConfigReader interface + InsecureFastScrypt func() bool + type ScryptParams struct + N int + P int + func GetScryptParams(config ScryptConfigReader) ScryptParams + type Sleeper interface + After func() time.Duration + Duration func() time.Duration + Reset func() + Sleep func() + type SleeperTask interface + Stop func() error + WakeUp func() + WakeUpIfStarted func() + func NewSleeperTask(worker Worker) SleeperTask + type StartStopOnce struct + func (once *StartStopOnce) Healthy() error + func (once *StartStopOnce) IfNotStopped(f func()) (ok bool) + func (once *StartStopOnce) IfStarted(f func()) (ok bool) + func (once *StartStopOnce) Ready() error + func (once *StartStopOnce) StartOnce(name string, fn func() error) error + func (once *StartStopOnce) State() StartStopOnceState + func (once *StartStopOnce) StopOnce(name string, fn func() error) error + type StartStopOnceState int32 + const StartStopOnce_StartFailed + const StartStopOnce_Started + const StartStopOnce_Starting + const StartStopOnce_StopFailed + const StartStopOnce_Stopped + const StartStopOnce_Stopping + const StartStopOnce_Unstarted + func (s StartStopOnceState) String() string + type TickerBase interface + Destroy func() + Pause func() + Resume func() + Ticks func() <-chan time.Time + type Worker interface + Name func() string + Work func() + func SleeperFuncTask(work func(), name string) Worker