util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataElementSeparator = "*"
	SubElementSeparator  = ":"
	RepetitionSeparator  = "^"
	SegmentTerminator    = "~"
)
View Source
const (
	LOOP_1000A  = "1000A"
	LOOP_1000B  = "1000B"
	LOOP_2000A  = "2000A"
	LOOP_2000B  = "2000B"
	LOOP_2010AA = "2010AA"
	LOOP_2010AB = "2010AB"
	LOOP_2010BA = "2010BA"
	LOOP_2010BB = "2010BB"
	LOOP_2310A  = "2310A"
	LOOP_2310B  = "2310B"
	LOOP_2310C  = "2310C"
	LOOP_2330B  = "2330B"
	LOOP_2330C  = "2330C"
	LOOP_2420A  = "2420A"
	LOOP_2100A  = "2100A"
	LOOP_2100B  = "2100B"
	LOOP_2100C  = "2100C"
	LOOP_2100D  = "2100D"
)

Variables

This section is empty.

Functions

func GetFieldByIndex

func GetFieldByIndex(r any, index string) any

func GetMask

func GetMask(mask, defaultMask string) string

func GetRecordSize

func GetRecordSize(line string) int64

func ReadCompositeField

func ReadCompositeField(input string, start int, spec rules.ElementRule, mask string, args ...string) (string, int, error)

func ReadField

func ReadField(input string, start int, spec rules.ElementRule, mask string) (string, int, error)

func ReadFieldAsInt

func ReadFieldAsInt(input string, start int, spec rules.ElementRule, mask string) (int64, int, error)

func SetFieldByIndex

func SetFieldByIndex(r any, index string, data any) error

func ValidateField

func ValidateField(data any, spec rules.ElementRule, mask string) error

func ValidateLoopCode

func ValidateLoopCode(code string) error

func ValidateLoopCodeForHl

func ValidateLoopCodeForHl(code string) error

func ValidateLoopCodeForNM1

func ValidateLoopCodeForNM1(code string) error

func ValidateLoopCodeForPer

func ValidateLoopCodeForPer(code string) error

func ValidateLoopCodeForPrv

func ValidateLoopCodeForPrv(code string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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