validators

package
v1.0.0-beta.15....-0de5f12 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package validators leverages package guards to provide easy to use validation functions.

Index

Constants

View Source
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.

Jump to

Keyboard shortcuts

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