Documentation
¶
Index ¶
- Variables
- func CheckAvailableCodes(codes string, codeMap map[string]string) bool
- func CopyStruct(from interface{}, to interface{})
- func GetField(from interface{}, fieldName string) (reflect.Value, error)
- func IsNumeric(data string) error
- func NewErrFieldRequired(field string) error
- func NewErrRecordSequenceNumber(field string) error
- func NewErrRecordType(field string) error
- func NewErrUnexpectedRecord(name string, record interface{}) error
- func NewErrValidValue(field string) error
- func ParseValue(fields reflect.Value, spec map[string]config.SpecField, record string) error
- func RandAlphanumericString(n int) (string, error)
- func ToString(elm config.SpecField, data reflect.Value) string
- func Validate(r interface{}, spec map[string]config.SpecField, rType string) error
- func ValidateCombinedFSCode(code int) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNonAlphanumeric is given when a field has non-alphanumeric characters ErrNonAlphanumeric = errors.New("has non alphanumeric characters") // ErrUpperAlpha is given when a field is not numeric characters ErrNumeric = errors.New("is not numeric characters") // ErrUpperAlpha is given when a field is an invalid phone number ErrPhoneNumber = errors.New("is an invalid phone number") // ErrValidYear is given when there's an invalid date ErrValidDate = errors.New("is an invalid Date") // ErrValidYear is given when a segment has an invalid length ErrRecordLength = errors.New("has an invalid length") // ErrValidField is given when there's an invalid field ErrValidField = errors.New("is an invalid field") // ErrShortRecord is given when the record is too short ErrShortRecord = errors.New("is too short / missing data") // ErrEmail is given when a field is not email ErrEmail = errors.New("is not email address") // ErrPayeeExtBlock is given when payee record has not extension block for for each type of return ErrPayeeExtBlock = errors.New("should exist extension block") // ErrInvalidAscii is given when is invalid ascii ErrInvalidAscii = errors.New("is invalid ascii") // ErrInvalidFile is given when is invalid file ErrInvalidFile = errors.New("is invalid file") // ErrNonExistPayer is given when isn't payer record ErrNonExistPayer = errors.New("should exist payer record") // ErrNonExistEndPayer is given when isn't payer record ErrNonExistEndPayer = errors.New("should exist end of payer record") // ErrNonExistPayee is given when isn't payee record ErrNonExistPayee = errors.New("should exist at least one payee record") // ErrInvalidNumberPayees is given when has incorrect number of payees ErrInvalidNumberPayees = errors.New("has incorrect number of payees") // ErrIncorrectReturnIndicator is given when has incorrect return indicator ErrIncorrectReturnIndicator = errors.New("has incorrect return indicator") // ErrInvalidTotalAmounts is given when have invalid totals of any payment amount fields ErrInvalidTotalAmounts = errors.New("have invalid totals of any payment amount fields") // ErrUnexpectedPaymentAmount is given when has unexpected payment amount in B records ErrUnexpectedPaymentAmount = errors.New("has unexpected payment amount") // ErrUnexpectedTotalAmount is given when has unexpected totals of any payment amount in C,K record ErrUnexpectedTotalAmount = errors.New("has unexpected totals of any payment amount") // ErrInvalidTypeOfReturn is given when has invalid type of return ErrInvalidTypeOfReturn = errors.New("has invalid type of return") // ErrDuplicatedFSCode is given when has duplicated combined fs code in state records ErrDuplicatedFSCode = errors.New("has duplicated combined fs code") // ErrInvalidNumberPayers is given when has incorrect number of payers ErrInvalidNumberPayers = errors.New("has incorrect number of payers") // ErrInvalidTCC is given when is invalid transmitter control code ErrInvalidTCC = errors.New("is invalid transmitter control code") // ErrUnsupportedBlock is given when is not supported extension block of B record ErrUnsupportedBlock = errors.New("is not supported extension block of B record") // ErrUnknownPdfTemplate is given when is unknown pdf template ErrUnknownPdfTemplate = errors.New("is unknown pdf template") // ErrFdfGenerate is given when failed to generate fdf file ErrFdfGenerate = errors.New("failed to generate fdf file") // ErrPdfMerge is given when failed to merge pdf files ErrPdfMerge = errors.New("failed to merge pdf files") // ErrCFSFProgram is given when has invalid CF/SF program ErrCFSFProgram = errors.New("should be payee B records and the state totals K records") // ErrCFSFState is given when has invalid Combined Federal/State Code ErrCFSFState = errors.New("is invalid combined federal/tate code in K record") // ErrUnknownEncryptionType is given when is unknown encryption type ErrUnknownEncryptionType = errors.New("is unknown encryption type") // ErrNullFile is given when has null file ErrNullFile = errors.New("has null file") // ErrInvalidNonceLength is given when has invalid nonce length ErrInvalidNonceLength = errors.New("crypto/cipher: incorrect nonce length given to GCM") // ErrUnsupportedPdf is given when is unsupported pdf logic ErrUnsupportedPdf = errors.New("is unsupported pdf") // ErrUnsupportedField is given when is not supported field of B record ErrUnsupportedField = errors.New("is not supported field of B record") )
Functions ¶
func CheckAvailableCodes ¶ added in v0.1.4
to check amount codes
func CopyStruct ¶
func CopyStruct(from interface{}, to interface{})
to copy fields between struct instances
func NewErrFieldRequired ¶
NewErrFieldRequired returns a error that has empty required field
func NewErrRecordSequenceNumber ¶
NewErrRecordSequenceNumber returns a error that has invalid record sequence number
func NewErrRecordType ¶ added in v0.1.4
NewErrRecordType returns a error that has invalid record type
func NewErrUnexpectedRecord ¶
NewErrUnexpectedRecord returns a error that has unexpected record
func NewErrValidValue ¶
NewErrValidValue returns a error that has invalid value
func ParseValue ¶
parse field with string
func RandAlphanumericString ¶ added in v0.1.4
RandAlphanumericString returns a securely generated random string.
func ValidateCombinedFSCode ¶ added in v0.1.4
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.