package
0.0.5
Repository: https://github.com/goplugin/plugin.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# Functions

AddHexPrefix adds the previx (0x) to a given hex string.
No description provided by the author
No description provided by the author
CheckPasswordHash wraps around bcrypt.CompareHashAndPassword for a friendlier API.
CheckUint256 returns an error if n is out of bounds for a uint256.
CombinedContext creates a context that finishes when any of the provided signals finish.
ConcatBytes appends a bunch of byte arrays into a single byte array.
ContextFromChan creates a context that finishes when the provided channel receives or is closed.
CopyFileWithMaxPerms copies the file at `srcPath` to `dstPath` and ensures that it has permissions that are no more permissive than the given ones.
DebugPanic logs a panic exception being called.
DecodeEthereumTx takes an RLP hex encoded Ethereum transaction and returns a Transaction struct with all the fields accessible.
DurationFromNow returns the amount of time since the Time field was last updated.
EIP55CapitalizedAddress returns true iff possibleAddressString has the correct capitalization for an Ethereum address, per EIP 55.
EnsureDirAndMaxPerms ensures that the given path exists, that it's a directory, and that it has permissions that are no more permissive than the given ones.
EnsureFileMaxPerms ensures that the given file has permissions that are no more permissive than the given ones.
EnsureFilepathMaxPerms ensures that the file at the given filepath has permissions that are no more permissive than the given ones.
EVMBytesToUint64 converts a bytebuffer to uint64.
EVMEncodeBytes encodes arbitrary bytes as bytes expected by the EVM.
EVMTranscodeBool converts a json input to an EVM bool.
EVMTranscodeBytes converts a json input to an EVM bytes array.
EVMTranscodeInt256 converts a json input to an EVM int256.
EVMTranscodeJSONWithFormat given a JSON input and a format specifier, encode the value for use by the EVM.
EVMTranscodeUint256 converts a json input to an EVM uint256.
EVMWordBigInt returns a big.Int as an EVM word byte array, with support for a signed representation.
EVMWordSignedBigInt returns a big.Int as an EVM word byte array, with support for a signed representation.
EVMWordUint128 returns a uint128 as an EVM word byte array.
EVMWordUint64 returns a uint64 as an EVM word byte array.
FileContents returns the contents of a file as a string.
FileExists returns true if a file at the passed string exists.
FilesInDir returns an array of filenames in the directory.
FormatJSON applies indent to format a JSON response.
GetScryptParams fetches ScryptParams from a ScryptConfigReader.
HasHexPrefix returns true if the string starts with 0x.
HashPassword wraps around bcrypt.GenerateFromPassword for a friendlier API.
No description provided by the author
HexToUint256 returns the uint256 represented by s, or an error if it doesn't represent one.
No description provided by the author
IsEmptyAddress checks that the address is empty, synonymous with the zero account/address.
IsFileOwnedByChainlink attempts to read fileInfo to verify file owner.
ISO8601UTC formats given time to ISO8601.
IsQuoted checks if the first and last characters are either " or '.
JustError takes a tuple and returns the last entry, the error.
Keccak256 is a simplified interface for the legacy SHA3 implementation that Ethereum uses.
LogIfError logs an error if not nil.
LogListeningAddress returns the LogListeningAddress.
MaxBigs finds the maximum value of a list of big.Ints.
MaxInt finds the maximum value of a list of ints.
MaxUint32 finds the maximum value of a list of uint32s.
MinUint finds the minimum value of a list of uints.
MustHash returns the keccak256 hash, or panics on failure.
MustUnmarshalToMap performs UnmarshalToMap, panics upon failure.
NewBackoffSleeper returns a BackoffSleeper that is configured to sleep for 0 seconds initially, then backs off from 1 second minimum to 10 seconds maximum.
No description provided by the author
NewBig constructs a Big from *big.Int.
NewBigI constructs a Big from int64.
NewBoundedPriorityQueue creates a new BoundedPriorityQueue.
NewBoundedQueue creates a new BoundedQueue instance.
NewBytes32ID returns a randomly generated UUID that conforms to Ethereum bytes32.
NewDependentAwaiter creates a new DependentAwaiter.
NewMailbox creates a new mailbox instance.
NewMaxBytesReader returns a new MaxBytesReader, accepts a ReadCloser and limit.
NewPausableTicker creates a new PausableTicker.
NewResettableTimer creates a new ResettableTimer.
NewSecret returns a new securely random sequence of n bytes of entropy.
NewSleeperTask takes a worker and returns a SleeperTask.
NormalizedJSON returns a JSON representation of an object that has been normalized to produce a consistent output for hashing.
NullISO8601UTC returns formatted time if valid, empty string otherwise.
ParseEthereumAddress returns addressString as a go-ethereum Address, or an error if it's invalid, e.g.
RemoveHexPrefix removes the prefix (0x) of a given hex string.
RemoveQuotes removes the first and last character if they are both either " or ', otherwise it is a noop.
RetryWithBackoff retries the sleeper and backs off if not Done.
ReverseString returns its argument string reversed rune-wise left to right.
Sha256 returns a hexadecimal encoded string of a hashed input.
StringToHex converts a standard string to a hex encoded string.
StripBearer removes the 'Bearer: ' prefix from the HTTP Authorization header.
ToDecimal converts an input to a decimal.
TooPermissive checks if the file has more than the allowed permissions.
Uint256ToBytes is x represented as the bytes of a uint256.
Uint256ToBytes32 returns the bytes32 encoding of the big int provided.
Uint256ToHex returns the hex representation of n, or error if out of bounds.
Uint64ToHex converts the given uint64 value to a hex-value string.
UnmarshalToMap takes an input json string and returns a map[string]interface i.e.
WaitGroupChan creates a channel that closes when the provided sync.WaitGroup is done.
WithJitter adds +/- 10% to a duration.
WithoutZeroAddresses returns a list of addresses excluding the zero address.
WrapIfError decorates an error with the given message.
WriteFileWithMaxPerms writes `data` to `path` and ensures that the file has permissions that are no more permissive than the given ones.

# Constants

DefaultSecretSize is the entroy in bytes to generate a base64 string of 64 characters.
EVMWordByteLen the length of an EVM Word Byte.
EVMWordHexLen the length of an EVM Word Hex.
FastN is a shorter N parameter for testing.
FastP is a shorter P parameter for testing.
FormatBool encodes the output as bytes containing a bool.
FormatBytes encodes the output as bytes.
FormatInt256 encodes the output as bytes containing an int256.
FormatPreformatted encodes the output, assumed to be hex, as bytes.
FormatUint256 encodes the output as bytes containing a uint256.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

Client represents a HTTP Client.
DefaultScryptParams is for use in production.
EmptyHash is a hash of all zeroes, otherwise in Ethereum as 0x0000000000000000000000000000000000000000000000000000000000000000.
No description provided by the author
FastScryptParams is for use in tests, where you don't want to wear out your CPU with expensive key derivations, do not use it in production, or your encrypted keys will be easy to brute-force!.
MaxInt256 represents the largest number represented by an EVM word using signed encoding.
MaxUint256 represents the largest number represented by an EVM word.
MinInt256 represents the smallest number represented by an EVM word using signed encoding.
UnrestrictedClient represents a HTTP Client with no Transport restrictions.
ZeroAddress is an address of all zeroes, otherwise in Ethereum as 0x0000000000000000000000000000000000000000.

# Structs

BackoffSleeper is a sleeper that backs off on subsequent attempts.
No description provided by the author
BoundedPriorityQueue stores a series of BoundedQueues with associated priorities and capacities.
BoundedQueue is a FIFO queue that discards older items when it reaches its capacity.
Clock is a basic type for scheduling events in the application.
HTTPRequest holds the request and config struct for a http request.
HTTPRequestConfig holds the configurable settings for a http request.
HTTPResponseTooLargeError stores a limit, used to throw an error for HTTP Responses if they exceed the byte limit.
KeyedMutex allows to lock based on particular values.
Mailbox contains a notify channel, a mutual exclusive lock, a queue of interfaces, and a queue capacity.
MaxBytesReader is inspired by https://github.com/gin-contrib/size/blob/master/size.go.
PausableTicker stores a ticker with a duration.
RemoteServerError stores the response body and status code.
ResettableTimer stores a timer.
No description provided by the author
StartStopOnce contains a StartStopOnceState integer.

# Interfaces

Afterer is an interface that fulfills the After method, following the behavior of time.After.
AfterNower is an interface that fulfills the `After()` and `Now()` methods.go:generate mockery --name AfterNower --output ../internal/mocks/ --case=underscore.
DependentAwaiter contains Dependent funcs.
Nower is an interface that fulfills the Now method, following the behavior of time.Now.
No description provided by the author
Sleeper interface is used for tasks that need to be done on some interval, excluding Cron, like reconnecting.
SleeperTask represents a task that waits in the background to process some work.
Worker is a simple interface that represents some work to do repeatedly.

# Type aliases

Big stores large integers and can deserialize a variety of inputs.
BigFloat accepts both string and float JSON values.
BigIntSlice attaches the methods of sort.Interface to []*big.Int, sorting in increasing order.
No description provided by the author
StartStopOnceState holds the state for StartStopOnce.