Documentation
¶
Index ¶
- Variables
- func AckRawMessage(msg []byte) ([]byte, error)
- func Marshal(v any) ([]byte, error)
- func Unmarshal(msg Queryable, v any) error
- type Acknowledgement
- type AcknowledgmentCode
- type Component
- func (c *Component) Append(ne Element) error
- func (c *Component) Children() []Element
- func (c *Component) Delimiters() *Delimiters
- func (c *Component) Encode() ([]byte, error)
- func (c *Component) GetLocation(loc query.Location) (Element, error)
- func (c *Component) Header() *MessageHeader
- func (c *Component) Length() int
- func (c *Component) Location() query.Location
- func (c *Component) Name() string
- func (c *Component) Parent() Element
- func (c *Component) Position() int
- func (c *Component) SetLocation(loc query.Location, val Value) error
- func (c *Component) Subcomponent(index int) (*Subcomponent, error)
- func (c *Component) Subcomponents() []*Subcomponent
- func (c *Component) Type() ElementType
- func (c *Component) Value(escape ...bool) Value
- type Condition
- type ConditionFunc
- type Delimiter
- type DelimiterType
- type Delimiters
- type Element
- type ElementIterator
- type ElementType
- type Escaper
- type Field
- func (f *Field) Append(el Element) error
- func (f *Field) Children() []Element
- func (f *Field) Delimiters() *Delimiters
- func (f *Field) Encode() ([]byte, error)
- func (f *Field) GetLocation(loc query.Location) (Element, error)
- func (f *Field) Header() *MessageHeader
- func (f *Field) Length() int
- func (f *Field) Location() query.Location
- func (f *Field) Name() string
- func (f *Field) Parent() Element
- func (f *Field) Position() int
- func (f *Field) Repetition(index int) (*Repetition, error)
- func (f *Field) Repetitions() []*Repetition
- func (f *Field) SetLocation(loc query.Location, val Value) error
- func (f *Field) Type() ElementType
- func (f *Field) Value(escape ...bool) Value
- type Header
- type HeaderType
- type Marshaler
- type Message
- func (m *Message) Append(el Element) error
- func (m *Message) Children() []Element
- func (m *Message) Delimiters() *Delimiters
- func (m *Message) Encode() ([]byte, error)
- func (m *Message) GetLocation(loc query.Location) (Element, error)
- func (m *Message) HasSegment(id string) bool
- func (m *Message) Header() *MessageHeader
- func (m *Message) Length() int
- func (m *Message) Location() query.Location
- func (m *Message) Name() string
- func (m *Message) Parent() Element
- func (m *Message) Position() int
- func (m *Message) Query(q string) (Element, error)
- func (m *Message) QueryValue(q string) (*Value, error)
- func (m *Message) Raw() (*RawMessage, error)
- func (m *Message) Schema() (*schema.Message, error)
- func (m *Message) Segment(name string, idx ...int) (*Segment, error)
- func (m *Message) SegmentList() []string
- func (m *Message) Segments(id ...string) []*Segment
- func (m *Message) Select(q string) ([]Element, error)
- func (m *Message) SetLocation(loc query.Location, val Value) error
- func (m *Message) Type() ElementType
- func (m *Message) Value(escape ...bool) Value
- type MessageHeader
- type MessageType
- type ParserOption
- type ParserOptions
- type Queryable
- type RawComponent
- type RawField
- type RawMessage
- func (m *RawMessage) Decode() (*Message, error)
- func (m *RawMessage) Delimiters() *Delimiters
- func (m *RawMessage) JSON(pretty ...bool) ([]byte, error)
- func (m *RawMessage) QueryValue(q string) (*Value, error)
- func (m *RawMessage) Segments(id ...string) []RawSegment
- func (m *RawMessage) ToMessage() (*Message, error)
- func (m *RawMessage) Value() Value
- type RawRepetition
- type RawSegment
- type RawSegmentGroup
- type RawSubcomponent
- type RawTransform
- type Repetition
- func (r *Repetition) Append(el Element) error
- func (r *Repetition) Children() []Element
- func (r *Repetition) Component(idx int) (*Component, error)
- func (r *Repetition) Components() []*Component
- func (r *Repetition) Delimiters() *Delimiters
- func (r *Repetition) Encode() ([]byte, error)
- func (r *Repetition) GetLocation(loc query.Location) (Element, error)
- func (r *Repetition) Header() *MessageHeader
- func (r *Repetition) Length() int
- func (r *Repetition) Location() query.Location
- func (r *Repetition) Name() string
- func (r *Repetition) Parent() Element
- func (r *Repetition) Position() int
- func (r *Repetition) SetLocation(loc query.Location, val Value) error
- func (r *Repetition) Type() ElementType
- func (r *Repetition) Value(escape ...bool) Value
- type Segment
- func (s *Segment) Append(el Element) error
- func (s *Segment) Children() []Element
- func (s *Segment) Delimiters() *Delimiters
- func (s *Segment) Encode() ([]byte, error)
- func (s *Segment) Field(index int) (*Field, error)
- func (s *Segment) Fields() []*Field
- func (s *Segment) GetLocation(loc query.Location) (Element, error)
- func (s *Segment) Header() *MessageHeader
- func (s *Segment) Index() int
- func (s *Segment) Length() int
- func (s *Segment) Location() query.Location
- func (s *Segment) Name() string
- func (s *Segment) Parent() Element
- func (s *Segment) Position() int
- func (s *Segment) SetLocation(loc query.Location, val Value) error
- func (s *Segment) Type() ElementType
- func (s *Segment) Value(escape ...bool) Value
- type SegmentGroup
- func (g *SegmentGroup) Children() []Element
- func (g *SegmentGroup) Delimiters() *Delimiters
- func (g *SegmentGroup) GetLocation(_ query.Location) (Element, error)
- func (g *SegmentGroup) Length() int
- func (g *SegmentGroup) Location() query.Location
- func (g *SegmentGroup) Name() string
- func (g *SegmentGroup) Parent() Element
- func (g *SegmentGroup) Position() int
- func (g *SegmentGroup) Type() ElementType
- func (g *SegmentGroup) Value(escape ...bool) Value
- type SetDelimiter
- type Subcomponent
- func (el *Subcomponent) Append(_ Element) error
- func (el *Subcomponent) Children() []Element
- func (el *Subcomponent) Delimiters() *Delimiters
- func (el *Subcomponent) Encode() ([]byte, error)
- func (el *Subcomponent) GetLocation(loc query.Location) (Element, error)
- func (el *Subcomponent) Header() *MessageHeader
- func (el *Subcomponent) Length() int
- func (el *Subcomponent) Location() query.Location
- func (el *Subcomponent) Name() string
- func (el *Subcomponent) Parent() Element
- func (el *Subcomponent) Position() int
- func (el *Subcomponent) SetLocation(loc query.Location, val Value) error
- func (el *Subcomponent) Type() ElementType
- func (el *Subcomponent) Value(escape ...bool) Value
- type TrailerType
- type Unmarshaler
- type ValidationFunc
- type ValidationResult
- type Validator
- type Value
- func MarshalValue(v any) Value
- func NewDateTimeValue(date time.Time) Value
- func NewDateValue(date time.Time) Value
- func NewEmptyValue() Value
- func NewIntValue(v int) Value
- func NewStringValue(v string) Value
- func NewValue(v []byte) Value
- func UnescapeElement(el Element) (Value, error)
- func UnescapeValue(v []byte, delims *Delimiters) Value
- func (v Value) Bind(val any) error
- func (v Value) Bool() bool
- func (v Value) Bytes() []byte
- func (v Value) Date() time.Time
- func (v Value) Empty() bool
- func (v Value) Escape(delims *Delimiters) Value
- func (v Value) Float64() float64
- func (v Value) Int() int
- func (v Value) String() string
- func (v Value) Unescape(delims *Delimiters) Value
- type ValueTransform
- type Version
Constants ¶
This section is empty.
Variables ¶
var ( ErrEncodingTooShort = errors.New("invalid delimiters, encoding chars must be at least 5 bytes") ErrEncodingInvalid = errors.New("invalid encoding chars") )
Functions ¶
func AckRawMessage ¶
Types ¶
type Acknowledgement ¶
type AcknowledgmentCode ¶
type AcknowledgmentCode int
const ( AckUnknown AcknowledgmentCode = iota //UN AckApplicationAccept //AA AckApplicationError //AE AckApplicationReject //AR AckCommitAccept //CA AckCommitError //CE AckCommitReject //CR )
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
func NewComponent ¶
func NewComponent(parent Element, pos int, raw RawComponent) *Component
func (*Component) Delimiters ¶
func (c *Component) Delimiters() *Delimiters
func (*Component) GetLocation ¶
func (*Component) Header ¶
func (c *Component) Header() *MessageHeader
func (*Component) SetLocation ¶
func (*Component) Subcomponent ¶
func (c *Component) Subcomponent(index int) (*Subcomponent, error)
func (*Component) Subcomponents ¶
func (c *Component) Subcomponents() []*Subcomponent
func (*Component) Type ¶
func (c *Component) Type() ElementType
type ConditionFunc ¶
type DelimiterType ¶
type DelimiterType int
Type is an enum of valid delimiters
const ( InvalidDelimiter DelimiterType = iota //invalid SegmentDelimiter //segment FieldDelimiter //field RepetitionDelimiter //repetition ComponentDelimiter //component SubcomponentDelimiter //subcomponent EscapeDelimiter //escape TruncationDelimiter //truncation )
func DelimiterTypeString ¶
func DelimiterTypeString(s string) (DelimiterType, error)
DelimiterTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func DelimiterTypeValues ¶
func DelimiterTypeValues() []DelimiterType
DelimiterTypeValues returns all values of the enum
func (DelimiterType) IsADelimiterType ¶
func (i DelimiterType) IsADelimiterType() bool
IsADelimiterType returns "true" if the value is listed in the enum definition. "false" otherwise
func (DelimiterType) String ¶
func (i DelimiterType) String() string
type Delimiters ¶
type Delimiters struct {
Segment Delimiter
Field Delimiter
Repetition Delimiter
Component Delimiter
Subcomponent Delimiter
Escape Delimiter
Truncation Delimiter
}
Delimiters holds the message delimiters
func DefaultDelimiters ¶
func DefaultDelimiters() *Delimiters
DefaultDelimiters returns the default delimiters
func NewDelimiters ¶
func NewDelimiters(setters ...SetDelimiter) *Delimiters
func ParseDelimiters ¶
func ParseDelimiters(b []byte) (*Delimiters, error)
func (*Delimiters) EncodingCharsValue ¶
func (d *Delimiters) EncodingCharsValue() Value
func (*Delimiters) Escaper ¶
func (d *Delimiters) Escaper() *Escaper
func (*Delimiters) FieldSeparatorValue ¶
func (d *Delimiters) FieldSeparatorValue() Value
func (*Delimiters) Join ¶
func (d *Delimiters) Join(b [][]byte, typ DelimiterType) []byte
func (*Delimiters) Split ¶
func (d *Delimiters) Split(b []byte, typ DelimiterType) [][]byte
type Element ¶
type Element interface {
Type() ElementType
Name() string
Delimiters() *Delimiters
Header() *MessageHeader
Parent() Element
Children() []Element
Length() int
Position() int
Location() query.Location
Value(escape ...bool) Value
GetLocation(query.Location) (Element, error)
SetLocation(query.Location, Value) error
Append(Element) error
Encode() ([]byte, error)
}
Element interface for HL7 elements
type ElementIterator ¶
type ElementIterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶
func NewIterator(el Element) *ElementIterator
func (*ElementIterator) Next ¶
func (i *ElementIterator) Next() Element
type ElementType ¶
type ElementType int
ElementType is an enum of valid element types
const ( ElementInvalid ElementType = iota //invalid ElementBatch //batch ElementFile //file ElementMessage //message ElementSegmentGroup //group ElementSegment //segment ElementField //field ElementRepetition //repetition ElementComponent //component ElementSubcomponent //subcomponent )
func ElementTypeString ¶
func ElementTypeString(s string) (ElementType, error)
ElementTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ElementTypeValues ¶
func ElementTypeValues() []ElementType
ElementTypeValues returns all values of the enum
func (ElementType) IsAElementType ¶
func (i ElementType) IsAElementType() bool
IsAElementType returns "true" if the value is listed in the enum definition. "false" otherwise
func (ElementType) String ¶
func (i ElementType) String() string
type Escaper ¶
type Escaper struct {
// contains filtered or unexported fields
}
func NewEscaper ¶
func NewEscaper(delims *Delimiters) *Escaper
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (*Field) Delimiters ¶
func (f *Field) Delimiters() *Delimiters
func (*Field) Header ¶
func (f *Field) Header() *MessageHeader
func (*Field) Repetition ¶
func (f *Field) Repetition(index int) (*Repetition, error)
func (*Field) Repetitions ¶
func (f *Field) Repetitions() []*Repetition
func (*Field) Type ¶
func (f *Field) Type() ElementType
type Header ¶
type Header interface {
Type() HeaderType
Delimiters() *Delimiters
SendingApplication() string
SendingFacility() string
ReceivingApplication() string
ReceivingFacility() string
DateTime() time.Time
Security() string
}
func NewHeader ¶
func NewHeader(typ HeaderType) Header
type HeaderType ¶
type HeaderType int
HeaderType is an enum type for valid header types
const ( HeaderTypeMessage HeaderType = iota //MSH HeaderTypeFile //FHS HeaderTypeBatch //BHS )
func HeaderTypeString ¶
func HeaderTypeString(s string) (HeaderType, error)
HeaderTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func HeaderTypeValues ¶
func HeaderTypeValues() []HeaderType
HeaderTypeValues returns all values of the enum
func (HeaderType) IsAHeaderType ¶
func (i HeaderType) IsAHeaderType() bool
IsAHeaderType returns "true" if the value is listed in the enum definition. "false" otherwise
func (HeaderType) String ¶
func (i HeaderType) String() string
func (HeaderType) Trailer ¶
func (t HeaderType) Trailer() TrailerType
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func NewMessage(r io.Reader, opts ...ParserOption) (*Message, error)
func NewMessageFromBytes ¶
func NewMessageFromBytes(b []byte, opts ...ParserOption) (*Message, error)
func NewMessageFromFile ¶
func NewMessageFromFile(f string, opts ...ParserOption) (*Message, error)
func (*Message) Delimiters ¶
func (m *Message) Delimiters() *Delimiters
func (*Message) HasSegment ¶
func (*Message) Header ¶
func (m *Message) Header() *MessageHeader
func (*Message) Raw ¶
func (m *Message) Raw() (*RawMessage, error)
func (*Message) SegmentList ¶
func (*Message) Type ¶
func (m *Message) Type() ElementType
type MessageHeader ¶
type MessageHeader struct {
Delimiters *Delimiters `json:"delimiters" hl7:"MSH.1"`
SendingApplication string `json:"sending_application" hl7:"MSH.3"`
SendingFacility string `json:"sending_facility" hl7:"MSH.4"`
ReceivingApplication string `json:"receiving_application" hl7:"MSH.5"`
ReceivingFacility string `json:"receiving_facility" hl7:"MSH.6"`
MessageDate time.Time `json:"message_date" hl7:"MSH.7"`
Security string `json:"security" hl7:"MSH.8"`
MessageCode string `json:"type" hl7:"MSH.9.1"`
TriggerEvent string `json:"event_trigger" hl7:"MSH.9.2"`
MessageStructure string `json:"message_structure" hl7:"MSH.9.3"`
ControlID string `json:"control_id" hl7:"MSH.10"`
ProcessingID string `json:"processing_id" hl7:"MSH.11"`
VersionID string `json:"version_id" hl7:"MSH.12"`
SequenceNumber int `json:"sequence_number" hl7:"MSH.13"`
ContinuationPointer string `json:"continuation_pointer" hl7:"MSH.14"`
AcceptAcknowledgmentType string `json:"accept_acknowledgment" hl7:"MSH.15"`
ApplicationAcknowledgmentType string `json:"application_acknowledgment" hl7:"MSH.16"`
CountryCode string `json:"country_code" hl7:"MSH.17"`
CharacterSet string `json:"character_set" hl7:"MSH.18"`
PrincipalLanguage string `json:"principal_language" hl7:"MSH.19"`
AlternateCharacterSet string `json:"alternate_character_set" hl7:"MSH.20"`
ProfileID string `json:"profile_id" hl7:"MSH.21"`
SendingResponsibleOrgCode string `json:"sending_responsible_org_code" hl7:"MSH.22"`
ReceivingResponsibleOrgCode string `json:"receiving_responsible_org_code" hl7:"MSH.23"`
SendingNetworkAddress string `json:"sending_network_address" hl7:"MSH.24"`
ReceivingNetworkAddress string `json:"receiving_network_address" hl7:"MSH.25"`
}
func (*MessageHeader) MarshalHL7 ¶
func (h *MessageHeader) MarshalHL7() ([]byte, error)
func (*MessageHeader) MessageType ¶
func (h *MessageHeader) MessageType() MessageType
type MessageType ¶
func ParseMessageType ¶
func ParseMessageType(s string, delims *Delimiters) (MessageType, error)
func (MessageType) Encode ¶
func (t MessageType) Encode(delims *Delimiters) []byte
func (MessageType) String ¶
func (t MessageType) String() string
type ParserOption ¶
type ParserOption func(*ParserOptions)
func FixLineEndings ¶
func FixLineEndings() ParserOption
func PreParse ¶
func PreParse(t RawTransform) ParserOption
type ParserOptions ¶
type ParserOptions struct {
// contains filtered or unexported fields
}
func NewParserOptions ¶
func NewParserOptions(opts ...ParserOption) *ParserOptions
type Queryable ¶
type Queryable interface {
Delimiters() *Delimiters
QueryValue(q string) (*Value, error)
}
type RawComponent ¶
type RawComponent []RawSubcomponent
func (RawComponent) Query ¶
func (c RawComponent) Query(loc query.Location, delims ...*Delimiters) (*Value, error)
func (RawComponent) String ¶
func (c RawComponent) String(delims ...*Delimiters) string
func (RawComponent) Value ¶
func (c RawComponent) Value(delims ...*Delimiters) Value
type RawField ¶
type RawField []RawRepetition
func (RawField) String ¶
func (f RawField) String(delims ...*Delimiters) string
func (RawField) Value ¶
func (f RawField) Value(delims ...*Delimiters) Value
type RawMessage ¶
type RawMessage struct {
// contains filtered or unexported fields
}
func NewRawMessage ¶
func NewRawMessage(delims *Delimiters, segs ...RawSegment) *RawMessage
func ParseRaw ¶
func ParseRaw(b []byte, opts ...ParserOption) (*RawMessage, error)
func ReadRaw ¶
func ReadRaw(r io.Reader, opts ...ParserOption) (*RawMessage, error)
func (*RawMessage) Decode ¶
func (m *RawMessage) Decode() (*Message, error)
func (*RawMessage) Delimiters ¶
func (m *RawMessage) Delimiters() *Delimiters
func (*RawMessage) QueryValue ¶
func (m *RawMessage) QueryValue(q string) (*Value, error)
func (*RawMessage) Segments ¶
func (m *RawMessage) Segments(id ...string) []RawSegment
func (*RawMessage) ToMessage ¶
func (m *RawMessage) ToMessage() (*Message, error)
func (*RawMessage) Value ¶
func (m *RawMessage) Value() Value
type RawRepetition ¶
type RawRepetition []RawComponent
func (RawRepetition) Query ¶
func (r RawRepetition) Query(loc query.Location, delims ...*Delimiters) (*Value, error)
func (RawRepetition) String ¶
func (r RawRepetition) String(delims ...*Delimiters) string
func (RawRepetition) Value ¶
func (r RawRepetition) Value(delims ...*Delimiters) Value
type RawSegment ¶
type RawSegment []RawField
func (RawSegment) ID ¶
func (s RawSegment) ID() string
func (RawSegment) Query ¶
func (s RawSegment) Query(loc query.Location, delims ...*Delimiters) (*Value, error)
func (RawSegment) String ¶
func (s RawSegment) String(delims ...*Delimiters) string
func (RawSegment) Value ¶
func (s RawSegment) Value(delims ...*Delimiters) Value
type RawSegmentGroup ¶
type RawSegmentGroup []RawSegment
type RawSubcomponent ¶
type RawSubcomponent []byte
func (RawSubcomponent) String ¶
func (s RawSubcomponent) String() string
func (RawSubcomponent) Value ¶
func (s RawSubcomponent) Value() Value
type RawTransform ¶
type Repetition ¶
type Repetition struct {
// contains filtered or unexported fields
}
func NewRepetition ¶
func NewRepetition(parent Element, pos int, raw RawRepetition) *Repetition
func (*Repetition) Append ¶
func (r *Repetition) Append(el Element) error
func (*Repetition) Children ¶
func (r *Repetition) Children() []Element
func (*Repetition) Components ¶
func (r *Repetition) Components() []*Component
func (*Repetition) Delimiters ¶
func (r *Repetition) Delimiters() *Delimiters
func (*Repetition) Encode ¶
func (r *Repetition) Encode() ([]byte, error)
func (*Repetition) GetLocation ¶
func (r *Repetition) GetLocation(loc query.Location) (Element, error)
func (*Repetition) Header ¶
func (r *Repetition) Header() *MessageHeader
func (*Repetition) Length ¶
func (r *Repetition) Length() int
func (*Repetition) Location ¶
func (r *Repetition) Location() query.Location
func (*Repetition) Name ¶
func (r *Repetition) Name() string
func (*Repetition) Parent ¶
func (r *Repetition) Parent() Element
func (*Repetition) Position ¶
func (r *Repetition) Position() int
func (*Repetition) SetLocation ¶
func (r *Repetition) SetLocation(loc query.Location, val Value) error
func (*Repetition) Type ¶
func (r *Repetition) Type() ElementType
func (*Repetition) Value ¶
func (r *Repetition) Value(escape ...bool) Value
type Segment ¶
type Segment struct {
// contains filtered or unexported fields
}
func NewSegment ¶
func NewSegment(parent Element, pos int, raw RawSegment) *Segment
func (*Segment) Delimiters ¶
func (s *Segment) Delimiters() *Delimiters
func (*Segment) Header ¶
func (s *Segment) Header() *MessageHeader
func (*Segment) Type ¶
func (s *Segment) Type() ElementType
type SegmentGroup ¶
type SegmentGroup struct {
// contains filtered or unexported fields
}
func (*SegmentGroup) Children ¶
func (g *SegmentGroup) Children() []Element
func (*SegmentGroup) Delimiters ¶
func (g *SegmentGroup) Delimiters() *Delimiters
func (*SegmentGroup) GetLocation ¶
func (g *SegmentGroup) GetLocation(_ query.Location) (Element, error)
func (*SegmentGroup) Length ¶
func (g *SegmentGroup) Length() int
func (*SegmentGroup) Location ¶
func (g *SegmentGroup) Location() query.Location
func (*SegmentGroup) Name ¶
func (g *SegmentGroup) Name() string
func (*SegmentGroup) Parent ¶
func (g *SegmentGroup) Parent() Element
func (*SegmentGroup) Position ¶
func (g *SegmentGroup) Position() int
func (*SegmentGroup) Type ¶
func (g *SegmentGroup) Type() ElementType
func (*SegmentGroup) Value ¶
func (g *SegmentGroup) Value(escape ...bool) Value
type SetDelimiter ¶
type SetDelimiter func(*Delimiters)
func SetComponent ¶
func SetComponent(delim Delimiter) SetDelimiter
func SetField ¶
func SetField(delim Delimiter) SetDelimiter
func SetRepetition ¶
func SetRepetition(delim Delimiter) SetDelimiter
func SetSegment ¶
func SetSegment(delim Delimiter) SetDelimiter
func SetSubcomponent ¶
func SetSubcomponent(delim Delimiter) SetDelimiter
func SetTruncation ¶
func SetTruncation(delim Delimiter) SetDelimiter
type Subcomponent ¶
type Subcomponent struct {
// contains filtered or unexported fields
}
func NewEmptySubcomponent ¶
func NewEmptySubcomponent() *Subcomponent
func NewSubcomponent ¶
func NewSubcomponent(parent Element, pos int, v Value) *Subcomponent
func NewSubcomponentValue ¶
func NewSubcomponentValue(val Value) *Subcomponent
func (*Subcomponent) Append ¶
func (el *Subcomponent) Append(_ Element) error
func (*Subcomponent) Children ¶
func (el *Subcomponent) Children() []Element
func (*Subcomponent) Delimiters ¶
func (el *Subcomponent) Delimiters() *Delimiters
func (*Subcomponent) Encode ¶
func (el *Subcomponent) Encode() ([]byte, error)
func (*Subcomponent) GetLocation ¶
func (el *Subcomponent) GetLocation(loc query.Location) (Element, error)
func (*Subcomponent) Header ¶
func (el *Subcomponent) Header() *MessageHeader
func (*Subcomponent) Length ¶
func (el *Subcomponent) Length() int
func (*Subcomponent) Location ¶
func (el *Subcomponent) Location() query.Location
func (*Subcomponent) Name ¶
func (el *Subcomponent) Name() string
func (*Subcomponent) Parent ¶
func (el *Subcomponent) Parent() Element
func (*Subcomponent) Position ¶
func (el *Subcomponent) Position() int
func (*Subcomponent) SetLocation ¶
func (el *Subcomponent) SetLocation(loc query.Location, val Value) error
func (*Subcomponent) Type ¶
func (el *Subcomponent) Type() ElementType
func (*Subcomponent) Value ¶
func (el *Subcomponent) Value(escape ...bool) Value
type TrailerType ¶
type TrailerType int
const ( TrailerTypeNone TrailerType = iota //_ TrailerTypeFile //FTS TrailerTypeBatch //BTS )
func TrailerTypeString ¶
func TrailerTypeString(s string) (TrailerType, error)
TrailerTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func TrailerTypeValues ¶
func TrailerTypeValues() []TrailerType
TrailerTypeValues returns all values of the enum
func (TrailerType) IsATrailerType ¶
func (i TrailerType) IsATrailerType() bool
IsATrailerType returns "true" if the value is listed in the enum definition. "false" otherwise
func (TrailerType) String ¶
func (i TrailerType) String() string
type Unmarshaler ¶
type ValidationFunc ¶
type ValidationFunc func(Element) ValidationResult
func (ValidationFunc) Validate ¶
func (f ValidationFunc) Validate(e Element) ValidationResult
type ValidationResult ¶
func ValidateMessageSchema ¶
func ValidateMessageSchema(el Element) ValidationResult
func ValidateSegmentSchema ¶
func ValidateSegmentSchema(el Element) ValidationResult
type Validator ¶
type Validator interface {
Validate(Element) ValidationResult
}
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func MarshalValue ¶
func NewDateTimeValue ¶
func NewDateValue ¶
func NewEmptyValue ¶
func NewEmptyValue() Value
func NewIntValue ¶
func NewStringValue ¶
func UnescapeElement ¶
func UnescapeValue ¶
func UnescapeValue(v []byte, delims *Delimiters) Value
func (Value) Escape ¶
func (v Value) Escape(delims *Delimiters) Value
func (Value) Unescape ¶
func (v Value) Unescape(delims *Delimiters) Value
type ValueTransform ¶
type Version ¶
type Version int
func VersionString ¶
VersionString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Version) IsAVersion ¶
IsAVersion returns "true" if the value is listed in the enum definition. "false" otherwise