Documentation ¶
Overview ¶
Package validators leverages package guards to provide easy to use validation functions.
Index ¶
- Constants
- func Validate(validators ...Validatable) error
- type Validatable
- func ValidateAddresses(checkLastTrit bool, addrs ...Hash) Validatable
- func ValidateAttachedTransactionTrytes(trytes ...Trytes) Validatable
- func ValidateHashes(hashes ...Hash) Validatable
- func ValidateNonEmptyStrings(err error, slice ...string) Validatable
- func ValidateSecurityLevel(secLvl SecurityLevel) Validatable
- func ValidateSeed(seed Trytes) Validatable
- func ValidateStartEndOptions(start uint64, end *uint64) Validatable
- func ValidateTags(tags ...Trytes) Validatable
- func ValidateTransactionHashes(hashes ...Hash) Validatable
- func ValidateTransactionTrytes(trytes ...Trytes) Validatable
- func ValidateTransfers(transfers ...bundle.Transfer) Validatable
- func ValidateURIs(uris ...string) Validatable
Constants ¶
const MaxIndexDiff = 1000
MaxIndexDiff is the max delta between start and end options.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶
func Validate(validators ...Validatable) error
Validate calls all given validators or returns the first occurred error.
Types ¶
type Validatable ¶
type Validatable = func() error
Validatable is a function which validates something and returns an error if the validation fails.
func ValidateAddresses ¶
func ValidateAddresses(checkLastTrit bool, addrs ...Hash) Validatable
ValidateAddresses validates the given addresses which must include the checksum.
func ValidateAttachedTransactionTrytes ¶
func ValidateAttachedTransactionTrytes(trytes ...Trytes) Validatable
ValidateAttachedTransactionTrytes validates the given attached transaction trytes.
func ValidateHashes ¶
func ValidateHashes(hashes ...Hash) Validatable
ValidateHashes validates the given hashes.
func ValidateNonEmptyStrings ¶
func ValidateNonEmptyStrings(err error, slice ...string) Validatable
ValidateNonEmptyStrings checks for non empty string slices.
func ValidateSecurityLevel ¶
func ValidateSecurityLevel(secLvl SecurityLevel) Validatable
ValidateSecurityLevel validates the given security level.
func ValidateSeed ¶
func ValidateSeed(seed Trytes) Validatable
ValidateSeed validates the given seed.
func ValidateStartEndOptions ¶
func ValidateStartEndOptions(start uint64, end *uint64) Validatable
ValidateStartEndOptions validates the given start and optional end option.
func ValidateTags ¶
func ValidateTags(tags ...Trytes) Validatable
ValidateTags validates the given tags.
func ValidateTransactionHashes ¶
func ValidateTransactionHashes(hashes ...Hash) Validatable
ValidateTransactionHashes validates the given transaction hashes.
func ValidateTransactionTrytes ¶
func ValidateTransactionTrytes(trytes ...Trytes) Validatable
ValidateTransactionTrytes validates the given transaction trytes.
func ValidateTransfers ¶
func ValidateTransfers(transfers ...bundle.Transfer) Validatable
ValidateTransfers validates the given transfers.
func ValidateURIs ¶
func ValidateURIs(uris ...string) Validatable
ValidateURIs validates the given URIs for neighbor addition/removal.