Documentation
¶
Overview ¶
Package adatypes is used to define types use for parsing Adabas field definitions tables. It contains Adabas and Natural DDM like Map definitions. It converts Adabas types to GO types and vice versa. In addition it contains basic functions used to handle logging facilities and Adabas buffer parsing and generation.
Index ¶
- Constants
- Variables
- func FinitDefinitionCache()
- func FormatByteBuffer(header string, b []byte) string
- func FormatBytes(header string, b []byte, modSpace int, max int) string
- func FormatBytesWithLength(header string, b []byte, modSpace int, max int, showLength bool) string
- func InitDefinitionCache()
- func LogMultiLineString(logOutput string)
- func TimeTrack(start time.Time, name string)
- func Translate(locale, message string, args ...interface{}) string
- type AdaCollationType
- type AdaHyperExitType
- type AdaPhoneticType
- type AdaRange
- type AdaReferentialType
- type AdaSuperType
- func (adaType *AdaSuperType) AddSubEntry(name string, from uint16, to uint16)
- func (adaType *AdaSuperType) IsStructure() bool
- func (adaType *AdaSuperType) Length() uint32
- func (adaType *AdaSuperType) Option() string
- func (adaType *AdaSuperType) SetLength(length uint32)
- func (adaType *AdaSuperType) String() string
- func (adaType *AdaSuperType) Value() (adaValue IAdaValue, err error)
- type AdaType
- func NewLongNameType(fType FieldType, name string, shortName string) *AdaType
- func NewLongNameTypeWithLength(fType FieldType, name string, shortName string, length uint32) *AdaType
- func NewType(fType FieldType, name string) *AdaType
- func NewTypeWithLength(fType FieldType, name string, length uint32) *AdaType
- type BufferHelper
- func (helper *BufferHelper) Buffer() []byte
- func (helper *BufferHelper) Offset() uint32
- func (helper *BufferHelper) PutInt16(data int16) (err error)
- func (helper *BufferHelper) PutInt32(data int32) (err error)
- func (helper *BufferHelper) PutInt64(data int64) (err error)
- func (helper *BufferHelper) PutUInt16(data uint16) (err error)
- func (helper *BufferHelper) PutUInt32(data uint32) (err error)
- func (helper *BufferHelper) PutUInt64(data uint64) (err error)
- func (helper *BufferHelper) PutUInt8(data uint8) (err error)
- func (helper *BufferHelper) ReceiveBytes(length uint32) (res []byte, err error)
- func (helper *BufferHelper) ReceiveBytesOcc(occ int) (res []byte, err error)
- func (helper *BufferHelper) ReceiveInt16() (res int16, err error)
- func (helper *BufferHelper) ReceiveInt32() (res int32, err error)
- func (helper *BufferHelper) ReceiveInt64() (res int64, err error)
- func (helper *BufferHelper) ReceiveInt8() (res int8, err error)
- func (helper *BufferHelper) ReceiveString(length uint32) (res string, err error)
- func (helper *BufferHelper) ReceiveUInt16() (res uint16, err error)
- func (helper *BufferHelper) ReceiveUInt32() (res uint32, err error)
- func (helper *BufferHelper) ReceiveUInt64() (res uint64, err error)
- func (helper *BufferHelper) ReceiveUInt8() (res uint8, err error)
- func (helper *BufferHelper) Remaining() int
- func (helper *BufferHelper) Shrink(length uint32) (err error)
- type BufferOption
- type CommonType
- func (commonType *CommonType) AddFlag(flagOption FlagOption)
- func (commonType *CommonType) AddOption(fieldOption FieldOption)
- func (commonType *CommonType) ClearOption(fieldOption FieldOption)
- func (commonType *CommonType) Endian() binary.ByteOrder
- func (commonType *CommonType) GetParent() IAdaType
- func (commonType *CommonType) HasFlagSet(flagOption FlagOption) bool
- func (commonType *CommonType) IsOption(fieldOption FieldOption) bool
- func (commonType *CommonType) IsSpecialDescriptor() bool
- func (commonType *CommonType) IsStructure() bool
- func (commonType *CommonType) Level() uint8
- func (commonType *CommonType) Name() string
- func (commonType *CommonType) RemoveFlag(flagOption FlagOption)
- func (commonType *CommonType) SetEndian(endian binary.ByteOrder)
- func (commonType *CommonType) SetLevel(level uint8)
- func (commonType *CommonType) SetName(name string)
- func (commonType *CommonType) SetOption(option uint32)
- func (commonType *CommonType) SetParent(parentType IAdaType)
- func (commonType *CommonType) SetRange(r *AdaRange)
- func (commonType *CommonType) ShortName() string
- func (commonType *CommonType) Type() FieldType
- type Definition
- func (def *Definition) AppendType(adaType IAdaType)
- func (def *Definition) CreateAdabasRequest(store bool, secondCall bool, mainframe bool) (adabasRequest *Request, err error)
- func (def *Definition) CreateValues(forStoring bool) (err error)
- func (def *Definition) Descriptors(descriptors string) (desc []string, err error)
- func (def *Definition) DumpTypes(doLog bool, activeTree bool)
- func (def *Definition) DumpValues(doLog bool)
- func (def *Definition) Fieldnames() []string
- func (def *Definition) InitReferences()
- func (def *Definition) ParseBuffer(helper *BufferHelper, option *BufferOption) (res TraverseResult, err error)
- func (def *Definition) PutCache(reference string)
- func (def *Definition) Search(fieldName string) IAdaValue
- func (def *Definition) SearchByIndex(fieldName string, index []uint32, create bool) (value IAdaValue, err error)
- func (def *Definition) SearchType(fieldName string) (adaType IAdaType, err error)
- func (def *Definition) SetValueWithIndex(name string, index []uint32, x interface{}) error
- func (def *Definition) ShouldRestrictToFieldSlice(field []string) (err error)
- func (def *Definition) ShouldRestrictToFields(fields string) (err error)
- func (def *Definition) String() string
- func (def *Definition) TraverseTypes(t TraverserMethods, activeTree bool, x interface{}) error
- func (def *Definition) TraverseValues(t TraverserValuesMethods, x interface{}) (ret TraverseResult, err error)
- type ElementTraverser
- type Error
- type FieldCondition
- type FieldOption
- type FieldType
- type FlagOption
- type IAdaType
- type IAdaValue
- type ISearchNode
- type Isn
- type Log
- type Platform
- type PrepareTraverser
- type Request
- type RequestParser
- type SearchInfo
- type SearchNode
- type SearchTree
- type SearchValue
- type Stack
- type StructureType
- func NewLongNameStructureList(fType FieldType, name string, shortName string, occByteShort int16, ...) *StructureType
- func NewStructure() *StructureType
- func NewStructureCondition(fType FieldType, name string, subFields []IAdaType, condition FieldCondition) *StructureType
- func NewStructureEmpty(fType FieldType, name string, occByteShort int16, level uint8) *StructureType
- func NewStructureList(fType FieldType, name string, occByteShort int16, subFields []IAdaType) *StructureType
- func (adaType *StructureType) AddField(fieldType IAdaType)
- func (adaType *StructureType) IsStructure() bool
- func (adaType *StructureType) Length() uint32
- func (adaType *StructureType) NrFields() int
- func (adaType *StructureType) Option() string
- func (adaType *StructureType) RemoveField(fieldType *CommonType)
- func (adaType *StructureType) SetLength(length uint32)
- func (adaType *StructureType) SetRange(r *AdaRange)
- func (adaType *StructureType) String() string
- func (adaType *StructureType) Traverse(t TraverserMethods, level int, x interface{}) (err error)
- func (adaType *StructureType) Value() (adaValue IAdaValue, err error)
- type StructureValue
- func (value *StructureValue) Bytes() []byte
- func (value *StructureValue) Float() (float64, error)
- func (value *StructureValue) FormatBuffer(buffer *bytes.Buffer, option *BufferOption) uint32
- func (value *StructureValue) Get(fieldName string, index int) IAdaValue
- func (value *StructureValue) Int32() (int32, error)
- func (value *StructureValue) Int64() (int64, error)
- func (adavalue StructureValue) MultipleIndex() uint32
- func (value *StructureValue) NrElements() int
- func (value *StructureValue) NrValues(index uint32) int
- func (value *StructureValue) PeriodIndex() uint32
- func (adavalue *StructureValue) SetParent(parentAdaValue IAdaValue)
- func (value *StructureValue) SetStringValue(stValue string)
- func (value *StructureValue) SetValue(v interface{}) error
- func (value *StructureValue) StoreBuffer(helper *BufferHelper) error
- func (value *StructureValue) String() string
- func (value *StructureValue) Traverse(t TraverserValuesMethods, x interface{}) (ret TraverseResult, err error)
- func (adavalue StructureValue) Type() IAdaType
- func (value *StructureValue) UInt32() (uint32, error)
- func (value *StructureValue) UInt64() (uint64, error)
- func (value *StructureValue) Value() interface{}
- type TraverseResult
- type Traverser
- type TraverserMethods
- type TraverserValues
- type TraverserValuesMethods
- Bugs
Examples ¶
Constants ¶
const ( // EQ Equals value comparisons EQ comparator = iota // LT Less than comparisons LT // LE Less equal comparisons LE // GT Greater than comparisons GT // GE Greater equal comparisons GE // NE Not equal comparison NE // NONE No comparison (Not needed) NONE )
const ( // EMPTY Empty (not needed) EMPTY logicBound = iota // AND AND logic AND // OR Adabas OR logic OR // MOR Adabas OR logic with same descriptor MOR // RANGE Range for a value RANGE // NOT NOT logic NOT )
const BufferOverflow = -1
BufferOverflow error indicates the read after the buffer maximal position
const ConstantIndicator = "#"
ConstantIndicator constant indicator is replaced with constants
const NoReferenceField = math.MaxInt32
NoReferenceField field out of range of given field possibilities
const OccByte = -12
OccByte Occurence identifier indicating that the occurence is defined as byte
const OccCapacity = -8
OccCapacity Occurence identifier indicating that the occurence capactity of MU or PE fields
const OccNone = -10
OccNone Occurence identifier indicating that the occurence is not used
const OccSingle = -9
OccSingle Occurence identifier indicating that the occurence single
const OccUInt2 = -11
OccUInt2 Occurence identifier indicating that the occurence is defined as uint32
const PartialLobSize = 4096
PartialLobSize partial lob read size of first read
const PlatformLUWHighOrder = 0x20
PlatformLUWHighOrder LUW high order architecture byte
const PlatformLUWLowOrder = 0x21
PlatformLUWLowOrder LUW low order architecture byte
const PlatformMainframe = 0x0
PlatformMainframe Mainframe architecture byte
Variables ¶
var Central = centralOptions{Log: logrus.New(), /* contains filtered or unexported fields */}
Central central configuration
Functions ¶
func FormatByteBuffer ¶
FormatByteBuffer formats the byte array to an output with a hexadecimal part, a ASCII part and a EBCDIC converted part of the same data
Example (Output) ¶
f, err := initLogWithFile("formatter.log") if err != nil { fmt.Println(err) return } defer f.Close() s := []byte("ABCDEFGHABCDEFGHABCDEFGHABCDEFGH") fmt.Println(FormatByteBuffer("ABC :", s))
Output: ABC :: Dump len=32(0x20) 0000 4142 4344 4546 4748 4142 4344 4546 4748 ABCDEFGHABCDEFGH ................ 0010 4142 4344 4546 4748 4142 4344 4546 4748 ABCDEFGHABCDEFGH ................
func FormatBytes ¶
FormatBytes formats a given byte array and modulo space operator. The modulo space defines the the possition a space is added to the output. The maximum give the maximum characters per line.
Example ¶
f, err := initLogWithFile("formatter.log") if err != nil { fmt.Println(err) return } defer f.Close() b := [5]byte{23, 44, 12, 33, 45} fmt.Println(FormatBytes("XXX : ", b[:], 4, -1)) s := []byte("ABCDEFGHIC") fmt.Println(FormatBytes("ABC : ", s, 0, -1)) e := [5]byte{0x81, 0x82, 0xc3, 0xc4, 0x86} fmt.Println(FormatBytes("EBCDIC : ", e[:], 5, -1))
Output: XXX : 172C0C21 2D [.,.!-] [.....] ABC : 41424344454647484943 [ABCDEFGHIC] [..........] EBCDIC : 8182C3C486 [��ÃÄ�] [abCDf]
Example (OmitDoubles) ¶
f, err := initLogWithFile("formatter.log") if err != nil { fmt.Println(err) return } defer f.Close() s := []byte("ABCDEFGHABCDEFGHABCDEFGHABCDEFGH") fmt.Println(FormatBytes("ABC :", s, 4, 8))
Output: ABC : 0000 41424344 45464748 [ABCDEFGH] [........] 0008 skipped equal lines 0018 41424344 45464748 [ABCDEFGH] [........]
Example (X) ¶
f, err := initLogWithFile("formatter.log") if err != nil { fmt.Println(err) return } defer f.Close() s := []byte("ABCDEFGHIJKLMNOPQRSTUVWXYT") fmt.Println(FormatBytes("ABC :", s, 4, 8))
Output: ABC : 0000 41424344 45464748 [ABCDEFGH] [........] 0008 494A4B4C 4D4E4F50 [IJKLMNOP] [...<(+|&] 0010 51525354 55565758 [QRSTUVWX] [........] 0018 5954 [YT ] [.. ]
func FormatBytesWithLength ¶
FormatBytesWithLength formats a given byte array and modulo space operator. The modulo space defines the the possition a space is added to the output. The maximum give the maximum characters per line. This function enhance the display with showing the length if showLength is set to true
func LogMultiLineString ¶
func LogMultiLineString(logOutput string)
LogMultiLineString log multi line string to log. This prevent the \n display in log. Instead multiple lines are written to log
Types ¶
type AdaCollationType ¶
type AdaCollationType struct { AdaType // contains filtered or unexported fields }
AdaCollationType data type structure for field types, no structures
func NewCollationType ¶
func NewCollationType(name string, length uint16, parentName string, collAttribute string) *AdaCollationType
NewCollationType creates new collation type instance
func (*AdaCollationType) String ¶
func (fieldType *AdaCollationType) String() string
String string representation of the collation type
type AdaHyperExitType ¶
type AdaHyperExitType struct { AdaType // contains filtered or unexported fields }
AdaHyperExitType data type structure for field types, no structures
func NewHyperExitType ¶
func NewHyperExitType(name string, length uint32, fdtFormat byte, nr uint8, parentNames []string) *AdaHyperExitType
NewHyperExitType new hyper exit type
func (*AdaHyperExitType) String ¶
func (fieldType *AdaHyperExitType) String() string
String string representation of the hyper exit type
type AdaPhoneticType ¶
type AdaPhoneticType struct { AdaType // contains filtered or unexported fields }
AdaPhoneticType data type phonetic descriptor for field types, no structures
func NewPhoneticType ¶
func NewPhoneticType(name string, descriptorLength uint16, parentName string) *AdaPhoneticType
NewPhoneticType new phonetic descriptor type
func (*AdaPhoneticType) String ¶
func (fieldType *AdaPhoneticType) String() string
String string representation of the phonetic type
type AdaRange ¶
type AdaRange struct {
// contains filtered or unexported fields
}
AdaRange Adabas range definition
func NewRangeParser ¶ added in v1.1.1
NewRangeParser new range using string parser
func NewSingleRange ¶
NewSingleRange new single dimensioned range
func (*AdaRange) FormatBuffer ¶
FormatBuffer generate corresponding format buffer
type AdaReferentialType ¶
type AdaReferentialType struct { AdaType // contains filtered or unexported fields }
AdaReferentialType data type structure for referential integrity types, no structures
func NewReferentialType ¶
func NewReferentialType(name string, refFile uint32, keys [2]string, refType uint8, refUpdateAction uint8, refDeleteAction uint8) *AdaReferentialType
NewReferentialType new referential integrity type
func (*AdaReferentialType) String ¶
func (fieldType *AdaReferentialType) String() string
String string representation of the hyper exit type
type AdaSuperType ¶
type AdaSuperType struct { CommonType FdtFormat byte Entries []subSuperEntries }
AdaSuperType data type structure for super or sub descriptor field types, no structures
func NewSuperType ¶
func NewSuperType(name string, option byte) *AdaSuperType
NewSuperType new super or sub descriptor field type
func (*AdaSuperType) AddSubEntry ¶
func (adaType *AdaSuperType) AddSubEntry(name string, from uint16, to uint16)
AddSubEntry add sub field entry on super or sub descriptors
func (*AdaSuperType) IsStructure ¶
func (adaType *AdaSuperType) IsStructure() bool
IsStructure return the structure of the field
func (*AdaSuperType) Length ¶
func (adaType *AdaSuperType) Length() uint32
Length return the length of the field
func (*AdaSuperType) Option ¶
func (adaType *AdaSuperType) Option() string
Option string representation of all option of Sub or super descriptors
func (*AdaSuperType) SetLength ¶
func (adaType *AdaSuperType) SetLength(length uint32)
SetLength set the length of the field
func (*AdaSuperType) String ¶
func (adaType *AdaSuperType) String() string
String string representation of the sub or super descriptor
func (*AdaSuperType) Value ¶
func (adaType *AdaSuperType) Value() (adaValue IAdaValue, err error)
Value value of the sub or super descriptor
type AdaType ¶
type AdaType struct { CommonType SysField byte EditMask byte SubOption byte }
AdaType data type structure for field types, no structures
func NewLongNameType ¶
NewLongNameType Define new type with length equal 1
func NewLongNameTypeWithLength ¶
func NewLongNameTypeWithLength(fType FieldType, name string, shortName string, length uint32) *AdaType
NewLongNameTypeWithLength Definen new type
func NewTypeWithLength ¶
NewTypeWithLength Definen new type
func (*AdaType) IsStructure ¶
IsStructure return if it is an structure
type BufferHelper ¶
type BufferHelper struct {
// contains filtered or unexported fields
}
BufferHelper buffer helper structure used to parse the buffer
func NewDynamicHelper ¶
func NewDynamicHelper(order binary.ByteOrder) *BufferHelper
NewDynamicHelper create a new buffer helper instance
func NewHelper ¶
func NewHelper(buffer []byte, max int, order binary.ByteOrder) *BufferHelper
NewHelper create a new buffer helper instance
func (*BufferHelper) Offset ¶
func (helper *BufferHelper) Offset() uint32
Offset offset of used bytes in the buffer
func (*BufferHelper) PutInt16 ¶
func (helper *BufferHelper) PutInt16(data int16) (err error)
PutInt16 put 2-byte integer
func (*BufferHelper) PutInt32 ¶
func (helper *BufferHelper) PutInt32(data int32) (err error)
PutInt32 put 4-byte integer
func (*BufferHelper) PutInt64 ¶
func (helper *BufferHelper) PutInt64(data int64) (err error)
PutInt64 put 8-byte integer
func (*BufferHelper) PutUInt16 ¶
func (helper *BufferHelper) PutUInt16(data uint16) (err error)
PutUInt16 put 2-byte unsigned integer
func (*BufferHelper) PutUInt32 ¶
func (helper *BufferHelper) PutUInt32(data uint32) (err error)
PutUInt32 put 4-byte unsigned integer
func (*BufferHelper) PutUInt64 ¶
func (helper *BufferHelper) PutUInt64(data uint64) (err error)
PutUInt64 put 8-byte unsigned integer
func (*BufferHelper) PutUInt8 ¶
func (helper *BufferHelper) PutUInt8(data uint8) (err error)
PutUInt8 put 1-byte unsigned integer
func (*BufferHelper) ReceiveBytes ¶
func (helper *BufferHelper) ReceiveBytes(length uint32) (res []byte, err error)
ReceiveBytes receive bytes length
func (*BufferHelper) ReceiveBytesOcc ¶
func (helper *BufferHelper) ReceiveBytesOcc(occ int) (res []byte, err error)
ReceiveBytesOcc receive bytes using a specific occurence
func (*BufferHelper) ReceiveInt16 ¶
func (helper *BufferHelper) ReceiveInt16() (res int16, err error)
ReceiveInt16 receive 2-byte integer
func (*BufferHelper) ReceiveInt32 ¶
func (helper *BufferHelper) ReceiveInt32() (res int32, err error)
ReceiveInt32 reveive 4-byte integer
func (*BufferHelper) ReceiveInt64 ¶
func (helper *BufferHelper) ReceiveInt64() (res int64, err error)
ReceiveInt64 reveive 8-byte integer
func (*BufferHelper) ReceiveInt8 ¶
func (helper *BufferHelper) ReceiveInt8() (res int8, err error)
ReceiveInt8 receive 1-byte integer
func (*BufferHelper) ReceiveString ¶
func (helper *BufferHelper) ReceiveString(length uint32) (res string, err error)
ReceiveString receive string of length
func (*BufferHelper) ReceiveUInt16 ¶
func (helper *BufferHelper) ReceiveUInt16() (res uint16, err error)
ReceiveUInt16 receive 2-byte unsigned integer
func (*BufferHelper) ReceiveUInt32 ¶
func (helper *BufferHelper) ReceiveUInt32() (res uint32, err error)
ReceiveUInt32 receive 4-byte unsigned integer
func (*BufferHelper) ReceiveUInt64 ¶
func (helper *BufferHelper) ReceiveUInt64() (res uint64, err error)
ReceiveUInt64 reveive 8-byte unsigned integer
func (*BufferHelper) ReceiveUInt8 ¶
func (helper *BufferHelper) ReceiveUInt8() (res uint8, err error)
ReceiveUInt8 receive 1-byte unsigned integer
func (*BufferHelper) Remaining ¶
func (helper *BufferHelper) Remaining() int
Remaining remaining bytes in the buffer
func (*BufferHelper) Shrink ¶
func (helper *BufferHelper) Shrink(length uint32) (err error)
Shrink shrink the buffer to the given length
type BufferOption ¶
type BufferOption struct { MultifetchCall bool StoreCall bool SecondCall bool NeedSecondCall bool HoldRecords bool ExchangeRecord bool PartialLobSize bool Ascending bool Mainframe bool // contains filtered or unexported fields }
BufferOption option for buffer parsing
func NewBufferOption ¶
func NewBufferOption(store bool, secondCall bool) *BufferOption
NewBufferOption create option to parse the buffer
func NewBufferOption3 ¶ added in v1.1.1
func NewBufferOption3(store bool, secondCall bool, mainframe bool) *BufferOption
NewBufferOption3 create option to parse the buffer
type CommonType ¶
type CommonType struct {
// contains filtered or unexported fields
}
CommonType common data type structure defined for all types
func (*CommonType) AddFlag ¶
func (commonType *CommonType) AddFlag(flagOption FlagOption)
AddFlag add the flag to the type flag set
func (*CommonType) AddOption ¶
func (commonType *CommonType) AddOption(fieldOption FieldOption)
AddOption add the option to the field
func (*CommonType) ClearOption ¶
func (commonType *CommonType) ClearOption(fieldOption FieldOption)
ClearOption clear the option to the field
func (*CommonType) Endian ¶
func (commonType *CommonType) Endian() binary.ByteOrder
Endian Get data endian
func (*CommonType) GetParent ¶
func (commonType *CommonType) GetParent() IAdaType
GetParent get the parent defined to this type
func (*CommonType) HasFlagSet ¶
func (commonType *CommonType) HasFlagSet(flagOption FlagOption) bool
HasFlagSet check if given flag is set
func (*CommonType) IsOption ¶
func (commonType *CommonType) IsOption(fieldOption FieldOption) bool
IsOption Check if the option of the field is set
func (*CommonType) IsSpecialDescriptor ¶
func (commonType *CommonType) IsSpecialDescriptor() bool
IsSpecialDescriptor return true if it is a special descriptor
func (*CommonType) IsStructure ¶
func (commonType *CommonType) IsStructure() bool
IsStructure return if the type is of structure types
func (*CommonType) Level ¶
func (commonType *CommonType) Level() uint8
Level Type return level of the field
func (*CommonType) Name ¶
func (commonType *CommonType) Name() string
Name return the name of the field
func (*CommonType) RemoveFlag ¶
func (commonType *CommonType) RemoveFlag(flagOption FlagOption)
RemoveFlag add the flag to the type flag set
func (*CommonType) SetEndian ¶
func (commonType *CommonType) SetEndian(endian binary.ByteOrder)
SetEndian Set data endian
func (*CommonType) SetLevel ¶
func (commonType *CommonType) SetLevel(level uint8)
SetLevel Set Adabas level of the field
func (*CommonType) SetName ¶
func (commonType *CommonType) SetName(name string)
SetName set the name of the field
func (*CommonType) SetOption ¶
func (commonType *CommonType) SetOption(option uint32)
SetOption Set all options of the field
func (*CommonType) SetParent ¶
func (commonType *CommonType) SetParent(parentType IAdaType)
SetParent set the parent of the type
func (*CommonType) SetRange ¶ added in v1.1.1
func (commonType *CommonType) SetRange(r *AdaRange)
SetRange set Adabas range
func (*CommonType) ShortName ¶
func (commonType *CommonType) ShortName() string
ShortName return the short name of the field
func (*CommonType) Type ¶
func (commonType *CommonType) Type() FieldType
Type returns field type of the field
type Definition ¶
type Definition struct { Values []IAdaValue // contains filtered or unexported fields }
Definition struct defines main entry point for parser structure
Example (AddValue) ¶
f, err := initLogWithFile("definition.log") if err != nil { return } defer f.Close() testDefinition := createPeriodGroupMultiplerField() testDefinition.DumpTypes(false, false) err = testDefinition.SetValueWithIndex("UB", nil, 1) if err != nil { fmt.Println("Add value to UB:", err) return } err = testDefinition.SetValueWithIndex("GC", []uint32{1}, "A") if err != nil { fmt.Println("Add Value of GC:", err) return } testDefinition.DumpValues(false)
Output: Dump all file field types: 1, U4, 4, B ; U4 PE=false MU=false REMOVE=true 1, B1, 1, F ; B1 PE=false MU=false REMOVE=true 1, UB, 1, B ; UB PE=false MU=false REMOVE=true 1, I2, 2, B ; I2 PE=false MU=false REMOVE=true 1, U8, 8, B ; U8 PE=false MU=false REMOVE=true 1, GR ,PE ; GR PE=true MU=true REMOVE=true PE=1-N 2, GC, 1, A ; GC PE=true MU=true REMOVE=true PE=1-N 2, GM, 5, P ,MU; GM PE=true MU=true REMOVE=true PE=1-N MU=1-N 3, GM, 5, P ; GM PE=true MU=true REMOVE=true 2, GS, 1, A ; GS PE=true MU=true REMOVE=true PE=1-N 2, GP, 1, P ; GP PE=true MU=true REMOVE=true PE=1-N 1, I8, 8, B ; I8 PE=false MU=false REMOVE=true Dump values : U4 = >0< B1 = >0< UB = >1< I2 = >0< U8 = >0< GR = [1] GC[1] = >65< GM[1] = [0] GS[1] = > < GP[1] = >0< I8 = >0<
Example (DumpValues) ¶
f, err := initLogWithFile("definition.log") if err != nil { return } defer f.Close() testDefinition := createPeriodGroupMultiplerField() testDefinition.DumpTypes(false, false) testDefinition.DumpValues(false)
Output: Dump all file field types: 1, U4, 4, B ; U4 PE=false MU=false REMOVE=true 1, B1, 1, F ; B1 PE=false MU=false REMOVE=true 1, UB, 1, B ; UB PE=false MU=false REMOVE=true 1, I2, 2, B ; I2 PE=false MU=false REMOVE=true 1, U8, 8, B ; U8 PE=false MU=false REMOVE=true 1, GR ,PE ; GR PE=true MU=true REMOVE=true PE=1-N 2, GC, 1, A ; GC PE=true MU=true REMOVE=true PE=1-N 2, GM, 5, P ,MU; GM PE=true MU=true REMOVE=true PE=1-N MU=1-N 3, GM, 5, P ; GM PE=true MU=true REMOVE=true 2, GS, 1, A ; GS PE=true MU=true REMOVE=true PE=1-N 2, GP, 1, P ; GP PE=true MU=true REMOVE=true PE=1-N 1, I8, 8, B ; I8 PE=false MU=false REMOVE=true Dump values : U4 = >0< B1 = >0< UB = >0< I2 = >0< U8 = >0< GR = [0] I8 = >0<
Example (DumpValuesAll) ¶
f, err := initLogWithFile("definition.log") if err != nil { fmt.Println("Error init log ", err) return } defer f.Close() testDefinition := createLayout() testDefinition.DumpTypes(false, true) testDefinition.DumpValues(false)
Output: Dump all active field types: 1, U4, 4, B ; U4 PE=false MU=false REMOVE=true 1, B1, 1, F ; B1 PE=false MU=false REMOVE=true 1, UB, 1, B ; UB PE=false MU=false REMOVE=true 1, I2, 2, B ; I2 PE=false MU=false REMOVE=true 1, U8, 8, B ; U8 PE=false MU=false REMOVE=true 1, PG ; PG PE=false MU=false REMOVE=true 2, GC, 1, A ; GC PE=false MU=false REMOVE=true 2, GS, 1, A ; GS PE=false MU=false REMOVE=true 2, GP, 1, P ; GP PE=false MU=false REMOVE=true 1, GM ; GM PE=false MU=false REMOVE=true 2, MA, 1, P ; MA PE=false MU=false REMOVE=true Dump values : U4 = >0< B1 = >0< UB = >0< I2 = >0< U8 = >0< PG = [1] GC = >0< GS = > < GP = >0< GM = [1] MA = >0<
Example (DumpValuesRestrict) ¶
f, err := initLogWithFile("definition.log") if err != nil { fmt.Println("Error init log ", err) return } defer f.Close() testDefinition := createLayout() err = testDefinition.ShouldRestrictToFields("U4,PG") if err != nil { fmt.Println("Error restrict fields ", err) return } testDefinition.DumpTypes(false, true) testDefinition.DumpValues(false)
Output: Dump all active field types: 1, U4, 4, B ; U4 PE=false MU=false REMOVE=false 1, PG ; PG PE=false MU=false REMOVE=false 2, GC, 1, A ; GC PE=false MU=false REMOVE=false 2, GS, 1, A ; GS PE=false MU=false REMOVE=false 2, GP, 1, P ; GP PE=false MU=false REMOVE=false Dump values : U4 = >0< PG = [1] GC = >0< GS = > < GP = >0<
Example (Search) ¶
f, err := initLogWithFile("definition.log") if err != nil { return } defer f.Close() testDefinition := createPeriodGroupMultiplerField() testDefinition.DumpTypes(false, false) err = testDefinition.SetValueWithIndex("UB", nil, 1) if err != nil { fmt.Println("Add value to UB:", err) return } err = testDefinition.SetValueWithIndex("GC", []uint32{1}, "A") if err != nil { fmt.Println("Add Value of GC:", err) return } err = testDefinition.SetValueWithIndex("GM", []uint32{1, 1}, 123) if err != nil { fmt.Println("Add Value of GM:", err) return } err = testDefinition.SetValueWithIndex("GM", []uint32{2, 1}, 555) if err != nil { fmt.Println("Add Value of GM:", err) return } Central.Log.Debugf("Add GM [2,2]") err = testDefinition.SetValueWithIndex("GM", []uint32{2, 2}, 111) if err != nil { fmt.Println("Add Value of GM:", err) return } Central.Log.Debugf("Add GM [2,3]") err = testDefinition.SetValueWithIndex("GM", []uint32{2, 3}, 777) if err != nil { fmt.Println("Add Value of GM:", err) return } Central.Log.Debugf("Done GM [2,3]") Central.Log.Debugf("Add GM [2,5]") err = testDefinition.SetValueWithIndex("GM", []uint32{2, 5}, 8888) if err != nil { fmt.Println("Add Value of GM:", err) return } Central.Log.Debugf("Done GM [2,5]") err = testDefinition.SetValueWithIndex("GM", []uint32{2, 15}, 10000) if err != nil { fmt.Println("Add Value of GM:", err) return } testDefinition.DumpValues(false)
Output: Dump all file field types: 1, U4, 4, B ; U4 PE=false MU=false REMOVE=true 1, B1, 1, F ; B1 PE=false MU=false REMOVE=true 1, UB, 1, B ; UB PE=false MU=false REMOVE=true 1, I2, 2, B ; I2 PE=false MU=false REMOVE=true 1, U8, 8, B ; U8 PE=false MU=false REMOVE=true 1, GR ,PE ; GR PE=true MU=true REMOVE=true PE=1-N 2, GC, 1, A ; GC PE=true MU=true REMOVE=true PE=1-N 2, GM, 5, P ,MU; GM PE=true MU=true REMOVE=true PE=1-N MU=1-N 3, GM, 5, P ; GM PE=true MU=true REMOVE=true 2, GS, 1, A ; GS PE=true MU=true REMOVE=true PE=1-N 2, GP, 1, P ; GP PE=true MU=true REMOVE=true PE=1-N 1, I8, 8, B ; I8 PE=false MU=false REMOVE=true Dump values : U4 = >0< B1 = >0< UB = >1< I2 = >0< U8 = >0< GR = [2] GC[1] = >65< GM[1] = [1] GM[1,1] = >123< GS[1] = > < GP[1] = >0< GC[2] = >0< GM[2] = [1] GM[2,1] = >555< GM[2,2] = >111< GM[2,3] = >777< GM[2,5] = >8888< GM[2,15] = >10000< GS[2] = > < GP[2] = >0< I8 = >0<
func CreateDefinitionByCache ¶
func CreateDefinitionByCache(reference string) *Definition
CreateDefinitionByCache create definition out of cache if available
func NewDefinitionWithTypes ¶
func NewDefinitionWithTypes(types []IAdaType) *Definition
NewDefinitionWithTypes create new Definition instance
func (*Definition) AppendType ¶
func (def *Definition) AppendType(adaType IAdaType)
AppendType append the given type to the type list
func (*Definition) CreateAdabasRequest ¶
func (def *Definition) CreateAdabasRequest(store bool, secondCall bool, mainframe bool) (adabasRequest *Request, err error)
CreateAdabasRequest creates format buffer out of defined metadata tree
func (*Definition) CreateValues ¶
func (def *Definition) CreateValues(forStoring bool) (err error)
CreateValues Create new value tree
func (*Definition) Descriptors ¶
func (def *Definition) Descriptors(descriptors string) (desc []string, err error)
Descriptors Return slice of descriptor field names given
func (*Definition) DumpTypes ¶
func (def *Definition) DumpTypes(doLog bool, activeTree bool)
DumpTypes traverse through the tree of definition calling a callback method
func (*Definition) DumpValues ¶
func (def *Definition) DumpValues(doLog bool)
DumpValues traverse through the tree of values calling a callback method
func (*Definition) Fieldnames ¶ added in v1.1.1
func (def *Definition) Fieldnames() []string
Fieldnames list of fields part of the query
func (*Definition) InitReferences ¶
func (def *Definition) InitReferences()
InitReferences Temporary flag inherit on all tree nodes
func (*Definition) ParseBuffer ¶
func (def *Definition) ParseBuffer(helper *BufferHelper, option *BufferOption) (res TraverseResult, err error)
ParseBuffer method start parsing the definition
func (*Definition) PutCache ¶
func (def *Definition) PutCache(reference string)
PutCache put cache entry of current definition
func (*Definition) Search ¶
func (def *Definition) Search(fieldName string) IAdaValue
Search search for a specific field structure in the tree
func (*Definition) SearchByIndex ¶
func (def *Definition) SearchByIndex(fieldName string, index []uint32, create bool) (value IAdaValue, err error)
SearchByIndex search for a specific field structure in the tree of an period group or multiple field
func (*Definition) SearchType ¶
func (def *Definition) SearchType(fieldName string) (adaType IAdaType, err error)
SearchType search for a type definition in the tree
func (*Definition) SetValueWithIndex ¶
func (def *Definition) SetValueWithIndex(name string, index []uint32, x interface{}) error
SetValueWithIndex Add value to an node element
func (*Definition) ShouldRestrictToFieldSlice ¶
func (def *Definition) ShouldRestrictToFieldSlice(field []string) (err error)
ShouldRestrictToFieldSlice Restrict the tree to contain only the given nodes
func (*Definition) ShouldRestrictToFields ¶
func (def *Definition) ShouldRestrictToFields(fields string) (err error)
ShouldRestrictToFields Restrict the tree to contain only the given nodes, remove the value tree
func (*Definition) String ¶
func (def *Definition) String() string
String return the content of the definition
func (*Definition) TraverseTypes ¶
func (def *Definition) TraverseTypes(t TraverserMethods, activeTree bool, x interface{}) error
TraverseTypes traverse through the tree of definition calling a callback method
func (*Definition) TraverseValues ¶
func (def *Definition) TraverseValues(t TraverserValuesMethods, x interface{}) (ret TraverseResult, err error)
TraverseValues traverse through the tree of values calling a callback method
type ElementTraverser ¶ added in v1.1.1
type ElementTraverser func(value IAdaValue, nr, max int, x interface{}) (TraverseResult, error)
ElementTraverser prepare start of an element
type Error ¶
Error error message with code and time
func NewGenericError ¶
func NewGenericError(code errorCode, args ...interface{}) *Error
NewGenericError create a genernic non Adabas response error
Example (Print) ¶
f, ferr := initLogWithFile("messages.log") if ferr != nil { fmt.Println(ferr) return } defer f.Close() err := NewGenericError(02, "XX") fmt.Println(err) fmt.Println("Code", err.Code) fmt.Println("Message", err.Message) err = NewGenericError(05) fmt.Println(err) fmt.Println("Code", err.Code) fmt.Println("Message", err.Message)
Output: ADG0000002: Invalid Adabas command send: XX Code ADG0000002 Message Invalid Adabas command send: XX ADG0000005: Repository not defined Code ADG0000005 Message Repository not defined
type FieldCondition ¶
type FieldCondition struct {
// contains filtered or unexported fields
}
FieldCondition field condition reference using for parser length management
func NewFieldCondition ¶
func NewFieldCondition(index int, ref int, condition map[byte][]byte) FieldCondition
NewFieldCondition creates a new field condition
type FieldOption ¶
type FieldOption uint32
FieldOption type for field option
const ( // FieldOptionUQ field option for unique descriptors FieldOptionUQ FieldOption = iota // FieldOptionNU field option for null suppression FieldOptionNU // FieldOptionFI field option for fixed size FieldOptionFI // FieldOptionDE field option for descriptors FieldOptionDE // FieldOptionNC field option for sql FieldOptionNC // FieldOptionNN field option for non null FieldOptionNN // FieldOptionHF field option for high order fields FieldOptionHF // FieldOptionNV field option for null value FieldOptionNV // FieldOptionNB field option for FieldOptionNB // FieldOptionHE field option for FieldOptionHE // FieldOptionPE field option for period FieldOptionPE // FieldOptionMU field option for multiple fields FieldOptionMU // FieldOptionLA field option for large alpha FieldOptionLA // FieldOptionLB field option for large objects FieldOptionLB // FieldOptionColExit field option for collation exit FieldOptionColExit )
type FieldType ¶
type FieldType uint
FieldType indicate a field type of the field
const ( // FieldTypeUndefined field type undefined FieldTypeUndefined FieldType = iota // FieldTypeUByte field type unsigned byte FieldTypeUByte // FieldTypeByte field type signed byte FieldTypeByte // FieldTypeUInt2 field type unsigned integer of 2 bytes FieldTypeUInt2 // FieldTypeInt2 field type signed integer of 2 bytes FieldTypeInt2 // FieldTypeShort field type signed short FieldTypeShort // FieldTypeUInt4 field type unsigned integer of 4 bytes FieldTypeUInt4 // FieldTypeUInt4Array field type array unsigned integer of 4 bytes FieldTypeUInt4Array // FieldTypeInt4 field type signed integer of 4 bytes FieldTypeInt4 // FieldTypeUInt8 field type unsigned integer of 8 bytes FieldTypeUInt8 // FieldTypeInt8 field type signed integer of 8 bytes FieldTypeInt8 // FieldTypeLong field type signed long FieldTypeLong // FieldTypePacked field type packed FieldTypePacked // FieldTypeUnpacked field type unpacked FieldTypeUnpacked // FieldTypeDouble field type double FieldTypeDouble // FieldTypeFloat field type float FieldTypeFloat // FieldTypeFiller field type for fill gaps between struct types FieldTypeFiller // FieldTypeString field type string FieldTypeString // FieldTypeByteArray field type byte array FieldTypeByteArray // FieldTypeCharacter field type character FieldTypeCharacter // FieldTypeLength field type for length definitions FieldTypeLength // FieldTypeUnicode field type unicode string FieldTypeUnicode // FieldTypeLAUnicode field type unicode large objects FieldTypeLAUnicode // FieldTypeLBUnicode field type unicode LOB FieldTypeLBUnicode // FieldTypeLAString field type string large objects FieldTypeLAString // FieldTypeLBString field type string LOB FieldTypeLBString // FieldTypeFieldLength field length FieldTypeFieldLength // FieldTypePeriodGroup field type period group FieldTypePeriodGroup // FieldTypeMultiplefield field type multiple fields FieldTypeMultiplefield // FieldTypeStructure field type of structured types FieldTypeStructure // FieldTypeGroup field type group FieldTypeGroup // FieldTypePackedArray field type packed array FieldTypePackedArray // FieldTypePhonetic field type of phonetic descriptor FieldTypePhonetic // FieldTypeSuperDesc field type of super descriptors FieldTypeSuperDesc // FieldTypeLiteral field type of literal data send to database FieldTypeLiteral // FieldTypeFieldCount field type to defined field count of MU or PE fields FieldTypeFieldCount // FieldTypeHyperDesc field type of Hyper descriptors FieldTypeHyperDesc // FieldTypeReferential field type for referential integrity FieldTypeReferential // FieldTypeCollation field type of collation descriptors FieldTypeCollation // FieldTypeFunction field type to define functions working on result list FieldTypeFunction )
func (FieldType) FormatCharacter ¶
FormatCharacter format character use to output FDT
type FlagOption ¶
type FlagOption uint
FlagOption flag option used to omit traversal through the tree (example is MU and PE)
const ( // FlagOptionPE indicate tree is part of period group FlagOptionPE FlagOption = iota // FlagOptionMU indicate tree contains MU fields FlagOptionMU // FlagOptionMUGhost ghost field for MU FlagOptionMUGhost // FlagOptionToBeRemoved should be removed FlagOptionToBeRemoved // FlagOptionSecondCall Field will need a second call to get the value FlagOptionSecondCall )
func (FlagOption) Bit ¶
func (flagOption FlagOption) Bit() uint8
Bit return the Bit of the option flag
type IAdaType ¶
type IAdaType interface { Type() FieldType String() string Name() string ShortName() string SetName(string) Value() (IAdaValue, error) Length() uint32 SetLength(uint32) SetRange(*AdaRange) IsStructure() bool Level() uint8 SetLevel(uint8) Option() string SetParent(IAdaType) GetParent() IAdaType HasFlagSet(FlagOption) bool AddFlag(FlagOption) RemoveFlag(FlagOption) IsOption(FieldOption) bool AddOption(FieldOption) IsSpecialDescriptor() bool SetEndian(binary.ByteOrder) Endian() binary.ByteOrder }
IAdaType data type interface defined for all types
type IAdaValue ¶
type IAdaValue interface { Type() IAdaType String() string Bytes() []byte PeriodIndex() uint32 MultipleIndex() uint32 FormatBuffer(buffer *bytes.Buffer, option *BufferOption) uint32 Value() interface{} SetParent(parentAdaValue IAdaValue) SetStringValue(string) SetValue(interface{}) error StoreBuffer(*BufferHelper) error // Int32 convert current Adabas value into integer value if possible, if not fill error Int32() (int32, error) UInt32() (uint32, error) Int64() (int64, error) UInt64() (uint64, error) Float() (float64, error) // contains filtered or unexported methods }
IAdaValue defines standard interface for all values
type ISearchNode ¶
type ISearchNode interface { String() string // contains filtered or unexported methods }
ISearchNode interface for adding search tree or nodes into tree
type Log ¶
type Log interface { Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) }
Log defines the log interface to manage other Log output frameworks
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
Platform platform definition structure
func NewPlatformIsl ¶
NewPlatformIsl create a new platform instance
func (*Platform) IsMainframe ¶
IsMainframe returns True if the platform is a Mainframe platform
type PrepareTraverser ¶ added in v1.1.1
type PrepareTraverser func(t interface{}, x interface{}) (TraverseResult, error)
PrepareTraverser prepare giving current main object
type Request ¶ added in v1.1.1
type Request struct { FormatBuffer bytes.Buffer RecordBuffer *BufferHelper RecordBufferLength uint32 RecordBufferShift uint32 PeriodLength uint32 SearchTree *SearchTree Parser RequestParser Limit uint64 Multifetch uint32 Descriptors []string Definition *Definition Response uint16 Isn Isn IsnQuantity uint64 Option *BufferOption }
Request contains all relevant buffer and parameters for a Adabas call
type RequestParser ¶
RequestParser function callback used to go through the list of received buffer
type SearchInfo ¶
type SearchInfo struct { Definition *Definition NeedSearch bool // contains filtered or unexported fields }
SearchInfo structure containing search parameters
func NewSearchInfo ¶
func NewSearchInfo(platform *Platform, search string) *SearchInfo
NewSearchInfo new search info base to create search tree
func (*SearchInfo) GenerateTree ¶
func (searchInfo *SearchInfo) GenerateTree() (tree *SearchTree, err error)
GenerateTree generate tree search information
type SearchNode ¶
type SearchNode struct {
// contains filtered or unexported fields
}
SearchNode node entry in the searchtree
func (*SearchNode) String ¶
func (node *SearchNode) String() string
type SearchTree ¶
type SearchTree struct {
// contains filtered or unexported fields
}
SearchTree tree entry point
func (*SearchTree) OrderBy ¶
func (tree *SearchTree) OrderBy() []string
OrderBy provide list of descriptor names for this search
func (*SearchTree) SearchBuffer ¶
func (tree *SearchTree) SearchBuffer() string
SearchBuffer returns search buffer of the search tree
func (*SearchTree) SearchFields ¶
func (tree *SearchTree) SearchFields() []string
SearchFields provide list of field names for this search
func (*SearchTree) String ¶
func (tree *SearchTree) String() string
String provide string of search tree
func (*SearchTree) ValueBuffer ¶
func (tree *SearchTree) ValueBuffer(buffer *bytes.Buffer)
ValueBuffer returns value buffer of the search tree
type SearchValue ¶
type SearchValue struct {
// contains filtered or unexported fields
}
SearchValue value endpoint
func (*SearchValue) String ¶
func (value *SearchValue) String() string
String shows the current value of the search value
type Stack ¶
type Stack struct { Size int // contains filtered or unexported fields }
Stack stack creates structure
type StructureType ¶
type StructureType struct { CommonType SubTypes []IAdaType // contains filtered or unexported fields }
StructureType creates a new structure type
func NewLongNameStructureList ¶
func NewLongNameStructureList(fType FieldType, name string, shortName string, occByteShort int16, subFields []IAdaType) *StructureType
NewLongNameStructureList Creates a new object of structured list types
func NewStructure ¶
func NewStructure() *StructureType
NewStructure Creates a new object of structured list types
func NewStructureCondition ¶
func NewStructureCondition(fType FieldType, name string, subFields []IAdaType, condition FieldCondition) *StructureType
NewStructureCondition Creates a new object of structured list types
func NewStructureEmpty ¶
func NewStructureEmpty(fType FieldType, name string, occByteShort int16, level uint8) *StructureType
NewStructureEmpty Creates a new object of structured list types
func NewStructureList ¶
func NewStructureList(fType FieldType, name string, occByteShort int16, subFields []IAdaType) *StructureType
NewStructureList Creates a new object of structured list types
func (*StructureType) AddField ¶
func (adaType *StructureType) AddField(fieldType IAdaType)
AddField add a new field type into the structure type
func (*StructureType) IsStructure ¶
func (adaType *StructureType) IsStructure() bool
IsStructure return the structure of the field
func (*StructureType) Length ¶
func (adaType *StructureType) Length() uint32
Length returns the length of the field
func (*StructureType) NrFields ¶
func (adaType *StructureType) NrFields() int
NrFields number of fields contained in the structure
func (*StructureType) Option ¶
func (adaType *StructureType) Option() string
Option return structure option as a string
func (*StructureType) RemoveField ¶
func (adaType *StructureType) RemoveField(fieldType *CommonType)
RemoveField remote field of the structure type
func (*StructureType) SetLength ¶
func (adaType *StructureType) SetLength(length uint32)
SetLength set the length of the field
func (*StructureType) SetRange ¶ added in v1.1.1
func (adaType *StructureType) SetRange(r *AdaRange)
SetRange set Adabas range
func (*StructureType) String ¶
func (adaType *StructureType) String() string
String return the name of the field
func (*StructureType) Traverse ¶
func (adaType *StructureType) Traverse(t TraverserMethods, level int, x interface{}) (err error)
Traverse Traverse through the definition tree calling a callback method for each node
func (*StructureType) Value ¶
func (adaType *StructureType) Value() (adaValue IAdaValue, err error)
Value return type specific value structure object
type StructureValue ¶
type StructureValue struct { Elements []*structureElement // contains filtered or unexported fields }
StructureValue structure value struct
func (*StructureValue) Bytes ¶
func (value *StructureValue) Bytes() []byte
Bytes byte array representation of the value
func (*StructureValue) FormatBuffer ¶
func (value *StructureValue) FormatBuffer(buffer *bytes.Buffer, option *BufferOption) uint32
FormatBuffer provide the format buffer of this structure
func (*StructureValue) Get ¶
func (value *StructureValue) Get(fieldName string, index int) IAdaValue
Get get the value of an named tree node with an specific index
func (StructureValue) MultipleIndex ¶
func (adavalue StructureValue) MultipleIndex() uint32
func (*StructureValue) NrElements ¶
func (value *StructureValue) NrElements() int
NrElements number of structure values
func (*StructureValue) NrValues ¶
func (value *StructureValue) NrValues(index uint32) int
NrValues number of structure values
func (*StructureValue) PeriodIndex ¶
func (value *StructureValue) PeriodIndex() uint32
PeriodIndex returns the period index of the structured value
func (*StructureValue) SetParent ¶
func (adavalue *StructureValue) SetParent(parentAdaValue IAdaValue)
func (*StructureValue) SetStringValue ¶
func (value *StructureValue) SetStringValue(stValue string)
SetStringValue set the string value of the value
func (*StructureValue) SetValue ¶
func (value *StructureValue) SetValue(v interface{}) error
SetValue set value for structure
func (*StructureValue) StoreBuffer ¶
func (value *StructureValue) StoreBuffer(helper *BufferHelper) error
StoreBuffer generate store buffer
func (*StructureValue) String ¶
func (value *StructureValue) String() string
func (*StructureValue) Traverse ¶
func (value *StructureValue) Traverse(t TraverserValuesMethods, x interface{}) (ret TraverseResult, err error)
Traverse Traverse through the definition tree calling a callback method for each node
func (*StructureValue) UInt32 ¶
func (value *StructureValue) UInt32() (uint32, error)
UInt32 not used
func (*StructureValue) UInt64 ¶
func (value *StructureValue) UInt64() (uint64, error)
UInt64 not used
func (*StructureValue) Value ¶
func (value *StructureValue) Value() interface{}
Value return the values of an structure value
type TraverseResult ¶
type TraverseResult int
TraverseResult Traverser result operation
const ( // Continue continue traversing the tree Continue TraverseResult = iota // EndTraverser end the traverser EndTraverser // SkipStructure skip all other elements of an structure SkipStructure // SkipTree skip tree of the structure value SkipTree )
type TraverserMethods ¶
type TraverserMethods struct { EnterFunction Traverser // contains filtered or unexported fields }
TraverserMethods structure for Traverser types
func NewTraverserMethods ¶
func NewTraverserMethods(enter Traverser) TraverserMethods
NewTraverserMethods new traverser methods structure
type TraverserValues ¶
type TraverserValues func(value IAdaValue, x interface{}) (TraverseResult, error)
TraverserValues api to handle tree traverses for values
type TraverserValuesMethods ¶
type TraverserValuesMethods struct { PrepareFunction PrepareTraverser EnterFunction TraverserValues LeaveFunction TraverserValues ElementFunction ElementTraverser }
TraverserValuesMethods structure for Traverser values
Notes ¶
Bugs ¶
Check if fields are valid!!!!
Source Files
¶
- ada_value.go
- adabas_request.go
- buffer_helper.go
- byte_array_value.go
- byte_formatter.go
- byte_value.go
- collation_value.go
- common.go
- common_type.go
- def_traverser.go
- definition.go
- definition_cache.go
- definition_restrict.go
- definition_search.go
- doc.go
- double_value.go
- float_value.go
- int2_value.go
- int4_value.go
- int8_value.go
- messages.go
- packed_value.go
- phonetic_value.go
- platform.go
- range.go
- referential_value.go
- search_tree.go
- stack.go
- static_messages.go
- string_value.go
- structure_value.go
- superdesc_value.go
- type.go
- unicode_value.go
- unpacked_value.go