edi

package
v0.0.2-beta.11 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemMaxItemCount = 10000
)

Variables

View Source
var (
	ErrEdiComponentElementIncorrectLocation = errors.New("edi component or element must be within a segment")
	ErrArrayRequiresItem                    = errors.New("array's must contain the item property")
	ErrSystemMaxItemCountExceeded           = errors.New("maximum array item count exceeded")
)
View Source
var (
	ErrUnexpectedInputType = errors.New("unexpected input type")
	ErrUnexpectedEDIType   = errors.New("unexpected edi type")
)

Functions

func Marshal

func Marshal(schema *model.Schema, input any, opts ...Option) ([]byte, error)

func Unmarshal

func Unmarshal(schema *model.Schema, input []byte, out any, opts ...Option) error

Unmarshal parses an EDI string based on the loaded JSON Schema and returns a map

Types

type Option

type Option func(o *Options)

func WithComponentSeparator

func WithComponentSeparator(s string) Option

func WithElementSeparator

func WithElementSeparator(s string) Option

func WithEscapeCharacter

func WithEscapeCharacter(e string) Option

func WithSegmentSeparator

func WithSegmentSeparator(s string) Option

type Options

type Options struct {
	SegmentSeparator   string
	ComponentSeparator string
	ElementSeparator   string
	EscapeCharacter    string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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