validate

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigIntFromString

func BigIntFromString(s string) (*big.Int, error)

func CheckApprovalType

func CheckApprovalType(parameter interface{}, variableName string) error

func CheckBigInt

func CheckBigInt(parameter interface{}, variableName string) error

func CheckBigIntRequired

func CheckBigIntRequired(parameter interface{}, variableName string) error

func CheckBoolean

func CheckBoolean(parameter interface{}, variableName string) error

func CheckChainId

func CheckChainId(parameter interface{}, variableName string) error

func CheckChainIdRequired

func CheckChainIdRequired(parameter interface{}, variableName string) error

func CheckConnectorTokens

func CheckConnectorTokens(parameter interface{}, variableName string) error

func CheckEthereumAddress

func CheckEthereumAddress(parameter interface{}, variableName string) error

func CheckEthereumAddressListRequired

func CheckEthereumAddressListRequired(parameter interface{}, variableName string) error

func CheckEthereumAddressRequired

func CheckEthereumAddressRequired(parameter interface{}, variableName string) error

func CheckExpireAfterUnix

func CheckExpireAfterUnix(parameter interface{}, variableName string) error

func CheckFee

func CheckFee(parameter interface{}, variableName string) error

func CheckFiatCurrency

func CheckFiatCurrency(parameter interface{}, variableName string) error

func CheckFloat32NonNegativeWhole

func CheckFloat32NonNegativeWhole(parameter interface{}, variableName string) error

func CheckJsonRpcVersion

func CheckJsonRpcVersion(parameter interface{}, variableName string) error

func CheckJsonRpcVersionRequired

func CheckJsonRpcVersionRequired(parameter interface{}, variableName string) error

func CheckLimit

func CheckLimit(parameter interface{}, variableName string) error

func CheckNodeType

func CheckNodeType(parameter interface{}, variableName string) error

func CheckOrderHash

func CheckOrderHash(parameter interface{}, variableName string) error

func CheckOrderHashRequired

func CheckOrderHashRequired(parameter interface{}, variableName string) error

func CheckPage

func CheckPage(parameter interface{}, variableName string) error

func CheckPermitHash

func CheckPermitHash(parameter interface{}, variableName string) error

func CheckPrivateKey

func CheckPrivateKey(parameter interface{}, variableName string) error

func CheckPrivateKeyRequired

func CheckPrivateKeyRequired(parameter interface{}, variableName string) error

func CheckProtocols

func CheckProtocols(parameter interface{}, variableName string) error

func CheckSlippage

func CheckSlippage(parameter interface{}, variableName string) error

func CheckSlippageRequired

func CheckSlippageRequired(parameter interface{}, variableName string) error

func CheckSortBy

func CheckSortBy(parameter interface{}, variableName string) error

func CheckStatusesInts

func CheckStatusesInts(parameter interface{}, variableName string) error

func CheckStatusesStrings

func CheckStatusesStrings(parameter interface{}, variableName string) error

func CheckString

func CheckString(parameter interface{}, variableName string) error

func CheckStringRequired

func CheckStringRequired(parameter interface{}, variableName string) error

func CheckTimerange

func CheckTimerange(parameter interface{}, variableName string) error

func ConsolidateValidationErorrs

func ConsolidateValidationErorrs(validationErrors []error) error

func GetValidatorErrorsCount

func GetValidatorErrorsCount(validationError error) int

GetValidatorErrorsCount uses the number of newlines in the error message to know how many errors were returned

func HasDuplicates

func HasDuplicates[T comparable](slice []T) bool

HasDuplicates checks if the provided slice contains any duplicate elements. It accepts a slice of any comparable type and returns true if there are duplicates, otherwise it returns false.

func IsSubset

func IsSubset[T comparable](sliceA, sliceB []T) bool

IsSubset checks if all elements of sliceA are also present in sliceB. It returns true if sliceA is a subset of sliceB, otherwise it returns false.

func NewParameterCustomError

func NewParameterCustomError(errorMessage string) error

func NewParameterMissingError

func NewParameterMissingError(variableName string) error

func NewParameterValidationError

func NewParameterValidationError(variableName string, errMessage string) error

func Parameter

func Parameter(parameter interface{}, variableName string, validationFunc ValidationFunc, validationErrors []error) []error

Types

type ValidationFunc

type ValidationFunc func(parameter interface{}, variableName string) error

Jump to

Keyboard shortcuts

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