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, bufferLength int, modSpace int, max int, ...) string
- func InitDefinitionCache()
- func Language() string
- func LogMultiLineString(debug bool, logOutput string)
- func SetValueData(s reflect.Value, v IAdaValue) error
- 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
- func (fieldType *AdaReferentialType) DeleteAction() string
- func (fieldType *AdaReferentialType) ForeignKeyName() string
- func (fieldType *AdaReferentialType) PrimaryKeyName() string
- func (fieldType *AdaReferentialType) ReferentialFile() uint32
- func (fieldType *AdaReferentialType) ReferentialType() string
- func (fieldType *AdaReferentialType) String() string
- func (fieldType *AdaReferentialType) UpdateAction() string
- type AdaSuperType
- func (adaType *AdaSuperType) AddSubEntry(name string, from uint16, to uint16)
- func (adaType *AdaSuperType) FormatType() rune
- func (adaType *AdaSuperType) Fractional() uint32
- func (adaType *AdaSuperType) InitSubTypes(definition *Definition) (err error)
- func (adaType *AdaSuperType) IsStructure() bool
- func (adaType *AdaSuperType) Length() uint32
- func (adaType *AdaSuperType) Option() string
- func (adaType *AdaSuperType) SetFormatLength(x uint32)
- func (adaType *AdaSuperType) SetFormatType(x rune)
- func (adaType *AdaSuperType) SetFractional(x uint32)
- 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(param ...interface{}) *AdaType
- func NewTypeWithFlag(fType FieldType, name string, flag FlagOption) *AdaType
- func NewTypeWithLength(fType FieldType, name string, length uint32) *AdaType
- func (adaType *AdaType) FormatType() rune
- func (adaType *AdaType) Fractional() uint32
- func (adaType *AdaType) IsStructure() bool
- func (adaType *AdaType) Length() uint32
- func (adaType *AdaType) Option() string
- func (adaType *AdaType) SetFormatLength(x uint32)
- func (adaType *AdaType) SetFormatType(x rune)
- func (adaType *AdaType) SetFractional(x uint32)
- func (adaType *AdaType) SetLength(length uint32)
- func (adaType *AdaType) String() string
- func (adaType *AdaType) Value() (adaValue IAdaValue, err error)
- type AdabasRequestParameter
- 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) Convert() ConvertUnicode
- 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) MultipleRange() *AdaRange
- func (commonType *CommonType) Name() string
- func (commonType *CommonType) PartialRange() *AdaRange
- func (commonType *CommonType) PeriodicRange() *AdaRange
- func (commonType *CommonType) RemoveFlag(flagOption FlagOption)
- func (commonType *CommonType) SetCharset(name string)
- func (commonType *CommonType) SetConvert(c ConvertUnicode)
- 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) SetPartialRange(partial *AdaRange)
- func (commonType *CommonType) SetRange(r *AdaRange)
- func (commonType *CommonType) ShortName() string
- func (commonType *CommonType) Type() FieldType
- type ConvertUnicode
- type Definition
- func (def *Definition) AdaptInterfaceFields(v reflect.Value, fm map[string][]string) error
- func (def *Definition) AdaptName(adaType IAdaType, newName string) error
- func (def *Definition) AppendType(adaType IAdaType)
- func (def *Definition) CheckField(name string) bool
- func (def *Definition) CreateAdabasRequest(parameter *AdabasRequestParameter) (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, msg ...string)
- func (def *Definition) DumpValues(doLog bool)
- func (def *Definition) Fieldnames() []string
- func (def *Definition) InitReferences()
- func (def *Definition) ParseBuffer(helper *BufferHelper, option *BufferOption, prefix string) (res TraverseResult, err error)
- func (def *Definition) PutCache(reference string)
- func (def *Definition) Register(t IAdaType)
- func (def *Definition) RemoveSpecialDescriptors() (err error)
- func (def *Definition) ResetRestrictToFields()
- func (def *Definition) RestrictFieldSlice(field []string) (err error)
- 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 DynamicInterface
- type ElementTraverser
- type Error
- type FieldCondition
- type FieldOption
- type FieldType
- type FlagOption
- type HoldType
- type IAdaCallInterface
- type IAdaType
- type IAdaValue
- type ILob
- type ISearchNode
- type Isn
- type Log
- type PartialValue
- type Platform
- type PrepareTraverser
- type RedefinitionType
- func (adaType *RedefinitionType) AddSubType(subType IAdaType)
- func (adaType *RedefinitionType) FormatType() rune
- func (adaType *RedefinitionType) Fractional() uint32
- func (adaType *RedefinitionType) IsStructure() bool
- func (adaType *RedefinitionType) Length() uint32
- func (adaType *RedefinitionType) Option() string
- func (adaType *RedefinitionType) SetFormatLength(x uint32)
- func (adaType *RedefinitionType) SetFormatType(x rune)
- func (adaType *RedefinitionType) SetFractional(x uint32)
- func (adaType *RedefinitionType) SetLength(length uint32)
- func (adaType *RedefinitionType) String() string
- func (adaType *RedefinitionType) Traverse(t TraverserMethods, level int, x interface{}) (err error)
- func (adaType *RedefinitionType) Value() (adaValue IAdaValue, err error)
- type RedefinitionValue
- func (value *RedefinitionValue) Bytes() []byte
- func (value *RedefinitionValue) Float() (float64, error)
- func (value *RedefinitionValue) FormatBuffer(buffer *bytes.Buffer, option *BufferOption) uint32
- func (value *RedefinitionValue) Int16() (int16, error)
- func (value *RedefinitionValue) Int32() (int32, error)
- func (value *RedefinitionValue) Int64() (int64, error)
- func (value *RedefinitionValue) Int8() (int8, error)
- func (adavalue RedefinitionValue) MultipleIndex() uint32
- func (adavalue *RedefinitionValue) Parent() IAdaValue
- func (adavalue *RedefinitionValue) PeriodIndex() uint32
- func (adavalue *RedefinitionValue) SetParent(parentAdaValue IAdaValue)
- func (value *RedefinitionValue) SetStringValue(stValue string)
- func (value *RedefinitionValue) SetValue(v interface{}) error
- func (value *RedefinitionValue) StoreBuffer(helper *BufferHelper, option *BufferOption) error
- func (value *RedefinitionValue) String() string
- func (value *RedefinitionValue) Traverse(t TraverserValuesMethods, x interface{}) (ret TraverseResult, err error)
- func (adavalue RedefinitionValue) Type() IAdaType
- func (value *RedefinitionValue) UInt16() (uint16, error)
- func (value *RedefinitionValue) UInt32() (uint32, error)
- func (value *RedefinitionValue) UInt64() (uint64, error)
- func (value *RedefinitionValue) UInt8() (uint8, error)
- func (value *RedefinitionValue) Value() interface{}
- type Request
- type RequestParser
- type SearchInfo
- type SearchNode
- type SearchTree
- type SearchValue
- type SecondCall
- type Stack
- type StructureTraverser
- 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) FormatType() rune
- func (adaType *StructureType) Fractional() uint32
- 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) ReplaceType(orgType, newType IAdaType) error
- func (adaType *StructureType) SetFormatLength(x uint32)
- func (adaType *StructureType) SetFormatType(x rune)
- func (adaType *StructureType) SetFractional(x uint32)
- 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) Int16() (int16, error)
- func (value *StructureValue) Int32() (int32, error)
- func (value *StructureValue) Int64() (int64, error)
- func (value *StructureValue) Int8() (int8, error)
- func (adavalue StructureValue) MultipleIndex() uint32
- func (value *StructureValue) NrElements() int
- func (value *StructureValue) NrValues(index uint32) int
- func (adavalue *StructureValue) Parent() IAdaValue
- 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, option *BufferOption) 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) UInt16() (uint16, error)
- func (value *StructureValue) UInt32() (uint32, error)
- func (value *StructureValue) UInt64() (uint64, error)
- func (value *StructureValue) UInt8() (uint8, error)
- func (value *StructureValue) Value() interface{}
- type StructureValueTraverser
- type TraverseResult
- type Traverser
- type TraverserMethods
- type TraverserValues
- type TraverserValuesMethods
- type UnicodeConverter
- Bugs
Examples ¶
- Definition (AddValue)
- Definition (DumpValues)
- Definition (DumpValuesAll)
- Definition (DumpValuesRestrict)
- Definition (Search)
- Definition (Treecopy)
- Definition.ShouldRestrictToFields
- FormatByteBuffer (Output)
- FormatBytes
- FormatBytes (OmitDoubles)
- FormatBytes (X)
- IAdaType (SetValue)
- IAdaType (Uint8SetValue)
- NewGenericError (Print)
Constants ¶
const ( // DefaultMultifetchLimit default number of multifetch entries DefaultMultifetchLimit = 10 // AdaNormal Adabas success response code AdaNormal = 0 )
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 (
// LastEntry last N name index for Adabas
LastEntry = -2
)
const NoReferenceField = math.MaxInt32
NoReferenceField field out of range of given field possibilities
const OccByte = -12
OccByte Occurrence identifier indicating that the occurrence is defined as byte
const OccCapacity = -8
OccCapacity Occurrence identifier indicating that the occurrence capactity of 2 or PE fields
const OccNone = -10
OccNone Occurrence identifier indicating that the occurrence is not used
const OccSingle = -9
OccSingle Occurrence identifier indicating that the occurrence single
const OccUInt2 = -11
OccUInt2 Occurrence identifier indicating that the occurrence is defined as uint32
const PartialLobSize = 4096
PartialLobSize partial lob read size of first read
const PartialStoreLobSizeChunks = 4096 * 10
PartialStoreLobSizeChunks chunk size storing lobs
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: lognil(), /* contains filtered or unexported fields */}
Central central configuration
var Version = "v1.6.19"
Version version of current build
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) ¶
err := initLogWithFile("formatter.log") if err != nil { fmt.Println(err) return } 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 ¶
func FormatBytes(header string, b []byte, bufferLength int, modSpace int, max int, showLength bool) string
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. This function enhance the display with showing the length if showLength is set to true
Example ¶
err := initLogWithFile("formatter.log") if err != nil { fmt.Println(err) return } b := [5]byte{23, 44, 12, 33, 45} fmt.Println(FormatBytes("XXX : ", b[:], len(b[:]), 4, -1, false)) s := []byte("ABCDEFGHIC") fmt.Println(FormatBytes("ABC : ", s, len(s), 0, -1, false)) e := [5]byte{0x81, 0x82, 0xc3, 0xc4, 0x86} fmt.Println(FormatBytes("EBCDIC : ", e[:], len(e[:]), 5, -1, false))
Output: XXX : 172c0c21 2d [.,.!-] [.....] ABC : 41424344454647484943 [ABCDEFGHIC] [..........] EBCDIC : 8182c3c486 [��ÃÄ�] [abCDf]
Example (OmitDoubles) ¶
err := initLogWithFile("formatter.log") if err != nil { fmt.Println(err) return } s := []byte("ABCDEFGHABCDEFGHABCDEFGHABCDEFGH") fmt.Println(FormatBytes("ABC :", s, len(s), 4, 8, false))
Output: ABC : 0000 41424344 45464748 [ABCDEFGH] [........] 0008 skipped equal lines 0018 41424344 45464748 [ABCDEFGH] [........]
Example (X) ¶
err := initLogWithFile("formatter.log") if err != nil { fmt.Println(err) return } s := []byte("ABCDEFGHIJKLMNOPQRSTUVWXYT") fmt.Println(FormatBytes("ABC :", s, len(s), 4, 8, false))
Output: ABC : 0000 41424344 45464748 [ABCDEFGH] [........] 0008 494a4b4c 4d4e4f50 [IJKLMNOP] [...<(+|&] 0010 51525354 55565758 [QRSTUVWX] [........] 0018 5954 [YT ] [.. ]
func LogMultiLineString ¶
LogMultiLineString log multi line string to log. This prevent the \n display in log. Instead multiple lines are written to log
func SetValueData ¶ added in v1.7.1
SetValueData dependent to the struct interface field the corresponding reflection struct the value will be set with the struct value.
Types ¶
type AdaCollationType ¶
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 ¶
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 NewPartialRange ¶ added in v1.7.1
NewPartialRange new partial range
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
func (*AdaRange) IsSingleIndex ¶ added in v1.7.1
IsSingleIndex is a single index query, although range available
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) DeleteAction ¶ added in v1.7.1
func (fieldType *AdaReferentialType) DeleteAction() string
DeleteAction delete action of referential integrity
func (*AdaReferentialType) ForeignKeyName ¶ added in v1.7.1
func (fieldType *AdaReferentialType) ForeignKeyName() string
ForeignKeyName foreign key name of referential integrity
func (*AdaReferentialType) PrimaryKeyName ¶ added in v1.7.1
func (fieldType *AdaReferentialType) PrimaryKeyName() string
PrimaryKeyName primary key name of referential integrity
func (*AdaReferentialType) ReferentialFile ¶ added in v1.7.1
func (fieldType *AdaReferentialType) ReferentialFile() uint32
ReferentialFile reference file of referential integrity
func (*AdaReferentialType) ReferentialType ¶ added in v1.7.1
func (fieldType *AdaReferentialType) ReferentialType() string
ReferentialType type of referential integrity
func (*AdaReferentialType) String ¶
func (fieldType *AdaReferentialType) String() string
String string representation of the hyper exit type
func (*AdaReferentialType) UpdateAction ¶ added in v1.7.1
func (fieldType *AdaReferentialType) UpdateAction() string
UpdateAction update action of referential integrity
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) FormatType ¶ added in v1.7.1
func (adaType *AdaSuperType) FormatType() rune
FormatType get format type
func (*AdaSuperType) Fractional ¶ added in v1.7.1
func (adaType *AdaSuperType) Fractional() uint32
Fractional get fractional part
func (*AdaSuperType) InitSubTypes ¶ added in v1.7.1
func (adaType *AdaSuperType) InitSubTypes(definition *Definition) (err error)
InitSubTypes init Adabas super/sub types with adabas definition
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) SetFormatLength ¶ added in v1.7.1
func (adaType *AdaSuperType) SetFormatLength(x uint32)
SetFormatLength set format length
func (*AdaSuperType) SetFormatType ¶ added in v1.7.1
func (adaType *AdaSuperType) SetFormatType(x rune)
SetFormatType set format type
func (*AdaSuperType) SetFractional ¶ added in v1.7.1
func (adaType *AdaSuperType) SetFractional(x uint32)
SetFractional set fractional part
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 FractValue uint32 }
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 Define new type
func NewType ¶
func NewType(param ...interface{}) *AdaType
NewType Define new type with length equal 1
func NewTypeWithFlag ¶ added in v1.7.1
func NewTypeWithFlag(fType FieldType, name string, flag FlagOption) *AdaType
NewTypeWithFlag Define new type with flag
func NewTypeWithLength ¶
NewTypeWithLength Definen new type
func (*AdaType) FormatType ¶ added in v1.7.1
FormatType get format type
func (*AdaType) Fractional ¶ added in v1.7.1
Fractional get fractional part
func (*AdaType) IsStructure ¶
IsStructure return if it is an structure
func (*AdaType) SetFormatLength ¶ added in v1.7.1
SetFormatLength set format length
func (*AdaType) SetFormatType ¶ added in v1.7.1
SetFormatType set format type
func (*AdaType) SetFractional ¶ added in v1.7.1
SetFractional set fractional part
type AdabasRequestParameter ¶ added in v1.7.1
type AdabasRequestParameter struct { Store bool SingleRead bool DescriptorRead bool PartialRead bool SecondCall uint32 Mainframe bool BlockSize uint32 }
AdabasRequestParameter Adabas request parameter defining type of Adabas request
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 occurrence
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 NeedSecondCall SecondCall ExchangeRecord bool Ascending bool Mainframe bool DescriptorRead bool StreamCursor uint8 LowerLimit uint64 SecondCall uint32 PartialRead bool BlockSize uint32 // contains filtered or unexported fields }
BufferOption option for buffer parsing
func NewBufferOption ¶
func NewBufferOption(store bool, secondCall uint32) *BufferOption
NewBufferOption create option to parse the buffer
func NewBufferOption3 ¶ added in v1.1.1
func NewBufferOption3(store bool, secondCall uint32, mainframe bool) *BufferOption
NewBufferOption3 create option to parse the buffer
type CommonType ¶
type CommonType struct { Charset string FormatTypeCharacter rune FormatLength uint32 SubTypes []IAdaType // 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) Convert ¶ added in v1.7.1
func (commonType *CommonType) Convert() ConvertUnicode
Convert convert function if type is Alpha/String
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) MultipleRange ¶ added in v1.7.1
func (commonType *CommonType) MultipleRange() *AdaRange
MultipleRange range of MU field provided
func (*CommonType) Name ¶
func (commonType *CommonType) Name() string
Name return the name of the field
func (*CommonType) PartialRange ¶ added in v1.7.1
func (commonType *CommonType) PartialRange() *AdaRange
PartialRange partial range provided
func (*CommonType) PeriodicRange ¶ added in v1.7.1
func (commonType *CommonType) PeriodicRange() *AdaRange
PeriodicRange range of PE field provided
func (*CommonType) RemoveFlag ¶
func (commonType *CommonType) RemoveFlag(flagOption FlagOption)
RemoveFlag add the flag to the type flag set
func (*CommonType) SetCharset ¶ added in v1.7.1
func (commonType *CommonType) SetCharset(name string)
SetCharset set charset converter
func (*CommonType) SetConvert ¶ added in v1.7.1
func (commonType *CommonType) SetConvert(c ConvertUnicode)
SetConvert set convert function if type is Alpha/String
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) SetPartialRange ¶ added in v1.7.1
func (commonType *CommonType) SetPartialRange(partial *AdaRange)
SetPartialRange set partial range
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 ConvertUnicode ¶ added in v1.7.1
ConvertUnicode unicode converter interface - Decode to decode byte array from unicode - Encode to encode byte array to unicode
type Definition ¶
type Definition struct { FileTime IAdaValue Values []IAdaValue // contains filtered or unexported fields }
Definition struct defines main entry point for parser structure
Example (AddValue) ¶
err := initLogWithFile("definition.log") if err != nil { return } 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 1, B1, 1, F ; B1 1, UB, 1, B ; UB 1, I2, 2, B ; I2 1, U8, 8, B ; U8 1, GR ,PE ; GR 2, GC, 1, A ; GC 2, GM, 5, P ,MU; GM 3, GM, 5, P ; GM 2, GS, 1, A ; GS 2, GP, 1, P ; GP 1, I8, 8, B ; I8 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) ¶
err := initLogWithFile("definition.log") if err != nil { return } testDefinition := createPeriodGroupMultiplerField() testDefinition.CreateValues(false) testDefinition.DumpTypes(false, false) testDefinition.DumpValues(false)
Output: Dump all file field types: 1, U4, 4, B ; U4 1, B1, 1, F ; B1 1, UB, 1, B ; UB 1, I2, 2, B ; I2 1, U8, 8, B ; U8 1, GR ,PE ; GR 2, GC, 1, A ; GC 2, GM, 5, P ,MU; GM 3, GM, 5, P ; GM 2, GS, 1, A ; GS 2, GP, 1, P ; GP 1, I8, 8, B ; I8 Dump values : U4 = >0< B1 = >0< UB = >0< I2 = >0< U8 = >0< GR = [0] I8 = >0<
Example (DumpValuesAll) ¶
err := initLogWithFile("definition.log") if err != nil { fmt.Println("Error init log ", err) return } testDefinition := createLayout() testDefinition.CreateValues(false) testDefinition.DumpTypes(false, true) testDefinition.DumpValues(false)
Output: Dump all active field types: 1, U4, 4, B ; U4 1, B1, 1, F ; B1 1, UB, 1, B ; UB 1, I2, 2, B ; I2 1, U8, 8, B ; U8 1, PG ; PG 2, GC, 1, A ; GC 2, GS, 1, A ; GS 2, GP, 1, P ; GP 1, GM ; GM 2, MA, 1, P ; MA 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) ¶
err := initLogWithFile("definition.log") if err != nil { fmt.Println("Error init log ", err) return } testDefinition := createLayout() err = testDefinition.ShouldRestrictToFields("U4,PG") if err != nil { fmt.Println("Error restrict fields ", err) return } testDefinition.CreateValues(false) testDefinition.DumpTypes(false, true) testDefinition.DumpValues(false)
Output: Dump all active field types: 1, U4, 4, B ; U4 1, PG ; PG 2, GC, 1, A ; GC 2, GS, 1, A ; GS 2, GP, 1, P ; GP Dump values : U4 = >0< PG = [1] GC = >0< GS = > < GP = >0<
Example (Search) ¶
err := initLogWithFile("definition.log") if err != nil { return } 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 1, B1, 1, F ; B1 1, UB, 1, B ; UB 1, I2, 2, B ; I2 1, U8, 8, B ; U8 1, GR ,PE ; GR 2, GC, 1, A ; GC 2, GM, 5, P ,MU; GM 3, GM, 5, P ; GM 2, GS, 1, A ; GS 2, GP, 1, P ; GP 1, I8, 8, B ; I8 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] = [5] 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<
Example (Treecopy) ¶
err := initLogWithFile("definition.log") if err != nil { return } testDefinition := createPeriodGroupSuperDescriptor() testDefinition.DumpTypes(false, false) if testDefinition.activeFieldTree != testDefinition.fileFieldTree { fmt.Println("ERROR equal") } err = testDefinition.copyActiveTree() if err != nil { fmt.Println("ERROR copyActiveTree", err) return } if testDefinition.activeFieldTree == testDefinition.fileFieldTree { fmt.Println("ERROR equal") } testDefinition.RemoveSpecialDescriptors() testDefinition.DumpTypes(false, false)
Output: Dump all file field types: 1, U4, 4, B ; U4 1, B1, 1, F ; B1 1, UB, 1, B ; UB 1, I2, 2, B ; I2 1, U8, 8, B ; U8 1, GR ,PE ; GR 2, GC, 1, A ; GC 2, GM, 5, P ,MU; GM 3, GM, 5, P ; GM 2, GS, 1, A ; GS 2, GP, 1, P ; GP 1, I8, 8, B ; I8 S1= ; S1 Dump all file field types: 1, U4, 4, B ; U4 1, B1, 1, F ; B1 1, UB, 1, B ; UB 1, I2, 2, B ; I2 1, U8, 8, B ; U8 1, GR ,PE ; GR 2, GC, 1, A ; GC 2, GM, 5, P ,MU; GM 3, GM, 5, P ; GM 2, GS, 1, A ; GS 2, GP, 1, P ; GP 1, I8, 8, B ; I8 S1= ; S1
func CreateDefinitionByCache ¶
func CreateDefinitionByCache(reference string) *Definition
CreateDefinitionByCache create definition out of cache if available
func NewDefinitionClone ¶ added in v1.7.1
func NewDefinitionClone(old *Definition) *Definition
NewDefinitionClone clone new Definition instance using old definition and clone the active tree to the new one
func NewDefinitionWithTypes ¶
func NewDefinitionWithTypes(types []IAdaType) *Definition
NewDefinitionWithTypes create new Definition instance adding the given types into the tree
func (*Definition) AdaptInterfaceFields ¶ added in v1.7.1
AdaptInterfaceFields adapt field value to interface field
func (*Definition) AdaptName ¶ added in v1.7.1
func (def *Definition) AdaptName(adaType IAdaType, newName string) error
AdaptName adapt new name to an definition entry
func (*Definition) AppendType ¶
func (def *Definition) AppendType(adaType IAdaType)
AppendType append the given type to the type list
func (*Definition) CheckField ¶ added in v1.7.1
func (def *Definition) CheckField(name string) bool
CheckField check field part of active fields
func (*Definition) CreateAdabasRequest ¶
func (def *Definition) CreateAdabasRequest(parameter *AdabasRequestParameter) (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, msg ...string)
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, prefix string) (res TraverseResult, err error)
ParseBuffer method start parsing the record Buffer using the definition. This may be by using either types or values (if available) to parse the buffer. Values may be available if second call is done or other means.
func (*Definition) PutCache ¶
func (def *Definition) PutCache(reference string)
PutCache put cache entry of current definition
func (*Definition) Register ¶ added in v1.7.1
func (def *Definition) Register(t IAdaType)
Register Register field types
func (*Definition) RemoveSpecialDescriptors ¶ added in v1.7.1
func (def *Definition) RemoveSpecialDescriptors() (err error)
RemoveSpecialDescriptors Remove special descriptors from query
func (*Definition) ResetRestrictToFields ¶ added in v1.7.1
func (def *Definition) ResetRestrictToFields()
ResetRestrictToFields reset restriction to all field of tree
func (*Definition) RestrictFieldSlice ¶ added in v1.7.1
func (def *Definition) RestrictFieldSlice(field []string) (err error)
RestrictFieldSlice Restrict the tree to contain only the given nodes
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 this method restrict the query to a given string slice of fields. If one field slice entry is set to '*', then all fields are read. A field definition may contain index information. The index information need to be set in square brackets. For example AA[1] will provide the first entry of a multiple field or all entries in the first occurrence of the period group. BB[1,2] will provide the first entry of the period group and the second entry of the multiple field.
func (*Definition) ShouldRestrictToFields ¶
func (def *Definition) ShouldRestrictToFields(fields string) (err error)
ShouldRestrictToFields this method restrict the query to a given comma-separated list of fields. If the fields is set to '*', then all fields are read. A field definition may contain index information. The index information need to be set in square brackets. For example AA[1] will provide the first entry of a multiple field or all entries in the first occurence of the period group. BB[1,2] will provide the first entry of the period group and the second entry of the multiple field.
Example ¶
err := initLogWithFile("definition.log") if err != nil { fmt.Println("Init log error:", err) return } InitDefinitionCache() testDefinition := createPeriodGroupMultiplerField() testDefinition.PutCache("AA") testDefinition.DumpTypes(false, false) testDefinition.DumpTypes(false, true) err = testDefinition.ShouldRestrictToFields("GC,I8") if err != nil { fmt.Println("Restrict original entry", err) return } definition := CreateDefinitionByCache("AA") if definition == nil { fmt.Println("Error create cache definition nil") return } err = definition.ShouldRestrictToFields("GC,I8") if err != nil { fmt.Println("Restrict cached entry error", err) return } definition.DumpTypes(false, false) definition.DumpTypes(false, true)
Output: Dump all file field types: 1, U4, 4, B ; U4 1, B1, 1, F ; B1 1, UB, 1, B ; UB 1, I2, 2, B ; I2 1, U8, 8, B ; U8 1, GR ,PE ; GR 2, GC, 1, A ; GC 2, GM, 5, P ,MU; GM 3, GM, 5, P ; GM 2, GS, 1, A ; GS 2, GP, 1, P ; GP 1, I8, 8, B ; I8 Dump all active field types: 1, U4, 4, B ; U4 1, B1, 1, F ; B1 1, UB, 1, B ; UB 1, I2, 2, B ; I2 1, U8, 8, B ; U8 1, GR ,PE ; GR 2, GC, 1, A ; GC 2, GM, 5, P ,MU; GM 3, GM, 5, P ; GM 2, GS, 1, A ; GS 2, GP, 1, P ; GP 1, I8, 8, B ; I8 Dump all file field types: 1, U4, 4, B ; U4 1, B1, 1, F ; B1 1, UB, 1, B ; UB 1, I2, 2, B ; I2 1, U8, 8, B ; U8 1, GR ,PE ; GR 2, GC, 1, A ; GC 2, GM, 5, P ,MU; GM 3, GM, 5, P ; GM 2, GS, 1, A ; GS 2, GP, 1, P ; GP 1, I8, 8, B ; I8 Dump all active field types: 1, GR ,PE ; GR 2, GC, 1, A ; GC 1, I8, 8, B ; I8
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 DynamicInterface ¶ added in v1.7.1
DynamicInterface dynamic interface
func CreateDynamicInterface ¶ added in v1.7.1
func CreateDynamicInterface(i interface{}) *DynamicInterface
CreateDynamicInterface constructor create dynamic interface
func (*DynamicInterface) CreateQueryFields ¶ added in v1.7.1
func (dynamic *DynamicInterface) CreateQueryFields() string
CreateQueryFields create query field list of dynamic interface given
func (*DynamicInterface) ExamineIsnField ¶ added in v1.7.1
func (dynamic *DynamicInterface) ExamineIsnField(value reflect.Value, isn Isn) error
ExamineIsnField set the interface Isn-tagged field with value for ISN
func (*DynamicInterface) ExtractIsnField ¶ added in v1.7.1
func (dynamic *DynamicInterface) ExtractIsnField(value reflect.Value) Isn
ExtractIsnField extract out of interface Isn-tagged field with value for ISN
func (*DynamicInterface) PutIsnField ¶ added in v1.7.1
func (dynamic *DynamicInterface) PutIsnField(value reflect.Value, isn Isn)
PutIsnField put ISN field back into structure
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 ¶
type Error struct { When time.Time Code string Message string // contains filtered or unexported fields }
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) ¶
ferr := initLogWithFile("messages.log") if ferr != nil { fmt.Println(ferr) return } 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(param ...interface{}) 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 // FieldTypeRedefinition field type group FieldTypeRedefinition // 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 EvaluateFieldType ¶ added in v1.7.1
EvaluateFieldType evaluate field type of format string
func (FieldType) FormatCharacter ¶
FormatCharacter format character use to output FDT
type FlagOption ¶
type FlagOption uint32
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 // FlagOptionAtomicFB indicate tree contains MU fields FlagOptionAtomicFB // FlagOptionMUGhost ghost field for MU FlagOptionMUGhost // FlagOptionToBeRemoved should be removed FlagOptionToBeRemoved // FlagOptionSecondCall Field will need a second call to get the value FlagOptionSecondCall // FlagOptionReference Field will skip parsing value FlagOptionReference // FlagOptionReadOnly read only field FlagOptionReadOnly // FlagOptionLengthNotIncluded length not include in record buffer FlagOptionLengthNotIncluded // FlagOptionPart structure is request only in parts FlagOptionPart // FlagOptionSingleIndex single index query FlagOptionSingleIndex // FlagOptionLengthPE instead of length use period group count FlagOptionLengthPE )
func (FlagOption) Bit ¶
func (flagOption FlagOption) Bit() uint32
Bit return the Bit of the option flag
type HoldType ¶ added in v1.1.2
type HoldType uint32
HoldType hold enum type
const ( // HoldNone no hold HoldNone HoldType = iota // HoldWait wait for hold released HoldWait // HoldResponse receive response code if record is in hold state HoldResponse // HoldAccess check during read that the record is not in hold (shared lock 'C') HoldAccess // HoldRead use shared lock until next read operation (shared lock 'Q') HoldRead // HoldTransaction use shared lock until end of transaction (shared lock 'S') HoldTransaction )
func (HoldType) HoldOption ¶ added in v1.7.1
HoldOption return hold option for Adabas option 3
type IAdaCallInterface ¶ added in v1.7.1
type IAdaCallInterface interface { SendSecondCall(adabasRequest *Request, x interface{}) (err error) CallAdabas() (err error) }
IAdaCallInterface caller interface
type IAdaType ¶
type IAdaType interface { Type() FieldType String() string Name() string ShortName() string SetName(string) Value() (IAdaValue, error) Length() uint32 SetLength(uint32) SetRange(*AdaRange) PartialRange() *AdaRange SetPartialRange(*AdaRange) PeriodicRange() *AdaRange MultipleRange() *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 SetFractional(uint32) SetCharset(string) SetFormatType(rune) FormatType() rune SetFormatLength(uint32) Fractional() uint32 Convert() ConvertUnicode }
IAdaType data type interface defined for all types
Example (SetValue) ¶
err := initLogWithFile("unpacked.log") if err != nil { fmt.Println("Error enable log") return } adaType := NewType(FieldTypeInt8, "I8") up := newInt8Value(adaType) fmt.Println("Integer default value :", up.value) up.SetValue(1000) fmt.Printf("Integer 1000 value : %d %T\n", up.value, up.value) up.SetValue(int64(math.MinInt64)) fmt.Printf("Integer minimal value : %d %T\n", up.value, up.value) up.SetValue(int64(math.MaxInt64)) fmt.Printf("Integer maximal value : %d %T\n", up.value, up.value) err = up.SetValue(int8(10)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 10 (8bit) value : %d %T\n", up.value, up.value) err = up.SetValue(int16(100)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 100 (16bit) value : %d %T\n", up.value, up.value) err = up.SetValue(int32(1000)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 1000 (32bit) value : %d %T\n", up.value, up.value) err = up.SetValue("87654") if err != nil { fmt.Println(err) return } fmt.Printf("Integer 87654 (string) value : %d %T\n", up.value, up.value) err = up.SetValue(uint8(10)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 10 (8bit) value : %d %T\n", up.value, up.value) err = up.SetValue(uint16(100)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 100 (16bit) value : %d %T\n", up.value, up.value) err = up.SetValue(uint32(1000)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 1000 (32bit) value : %d %T\n", up.value, up.value) err = up.SetValue([]byte{0x50}) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 80 (1-byte array) value : %d %T\n", up.value, up.value) err = up.SetValue([]byte{0xfe}) if err != nil { fmt.Println(err) return } fmt.Printf("Integer -2 (1-byte array) value : %d %T\n", up.value, up.value) if bigEndian() { err = up.SetValue([]byte{0x2, 0x50}) } else { err = up.SetValue([]byte{0x50, 0x2}) } if err != nil { fmt.Println(err) return } fmt.Printf("Integer 592 (2-byte array) value : %d %T\n", up.value, up.value) if bigEndian() { err = up.SetValue([]byte{0x4, 0x3, 0x2, 0x50}) } else { err = up.SetValue([]byte{0x50, 0x2, 0x3, 0x4}) } if err != nil { fmt.Println(err) return } fmt.Printf("Integer 67306064 (4-byte array) value : %d %T\n", up.value, up.value)
Output: Integer default value : 0 Integer 1000 value : 1000 int64 Integer minimal value : -9223372036854775808 int64 Integer maximal value : 9223372036854775807 int64 Integer 10 (8bit) value : 10 int64 Integer 100 (16bit) value : 100 int64 Integer 1000 (32bit) value : 1000 int64 Integer 87654 (string) value : 87654 int64 Integer 10 (8bit) value : 10 int64 Integer 100 (16bit) value : 100 int64 Integer 1000 (32bit) value : 1000 int64 Integer 80 (1-byte array) value : 80 int64 Integer -2 (1-byte array) value : -2 int64 Integer 592 (2-byte array) value : 592 int64 Integer 67306064 (4-byte array) value : 67306064 int64
Example (Uint8SetValue) ¶
err := initLogWithFile("unpacked.log") if err != nil { fmt.Println("Error enable log") return } adaType := NewType(FieldTypeUInt8, "U8") up := newUInt8Value(adaType) fmt.Println("Unsigned Integer default value :", up.value) up.SetValue(1000) fmt.Printf("Integer 1000 value : %d %T\n", up.value, up.value) err = up.SetValue(int64(math.MinInt64)) if err == nil { fmt.Println("ERROR: negative value should be cause error") return } fmt.Println(err) up.SetValue(int64(math.MaxInt64)) fmt.Printf("Integer maximal value : %d %T\n", up.value, up.value) err = up.SetValue(int8(10)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 10 (8bit) value : %d %T\n", up.value, up.value) err = up.SetValue(int16(100)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 100 (16bit) value : %d %T\n", up.value, up.value) err = up.SetValue(int32(1000)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 1000 (32bit) value : %d %T\n", up.value, up.value) err = up.SetValue("87654") if err != nil { fmt.Println(err) return } fmt.Printf("Integer 87654 (string) value : %d %T\n", up.value, up.value) err = up.SetValue(uint8(10)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 10 (8bit) value : %d %T\n", up.value, up.value) err = up.SetValue(uint16(100)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 100 (16bit) value : %d %T\n", up.value, up.value) err = up.SetValue(uint32(1000)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 1000 (32bit) value : %d %T\n", up.value, up.value) err = up.SetValue(uint8(80)) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 80 (1-byte array) value : %d %T\n", up.value, up.value) err = up.SetValue([]byte{0xfe}) if err != nil { fmt.Println(err) return } fmt.Printf("Integer 254 (1-byte array) value : %d %T\n", up.value, up.value) if bigEndian() { err = up.SetValue([]byte{0x2, 0x50}) } else { err = up.SetValue([]byte{0x50, 0x2}) } if err != nil { fmt.Println(err) return } fmt.Printf("Integer 592 (2-byte array) value : %d %T\n", up.value, up.value) if bigEndian() { err = up.SetValue([]byte{0x4, 0x3, 0x2, 0x50}) } else { err = up.SetValue([]byte{0x50, 0x2, 0x3, 0x4}) } if err != nil { fmt.Println(err) return } fmt.Printf("Integer 67306064 (4-byte array) value : %d %T\n", up.value, up.value)
Output: Unsigned Integer default value : 0 Integer 1000 value : 1000 uint64 ADG0000101: Cannot convert negative value to unsigned of type unsigned int64 (int64,-9223372036854775808) Integer maximal value : 9223372036854775807 uint64 Integer 10 (8bit) value : 10 uint64 Integer 100 (16bit) value : 100 uint64 Integer 1000 (32bit) value : 1000 uint64 Integer 87654 (string) value : 87654 uint64 Integer 10 (8bit) value : 10 uint64 Integer 100 (16bit) value : 100 uint64 Integer 1000 (32bit) value : 1000 uint64 Integer 80 (1-byte array) value : 80 uint64 Integer 254 (1-byte array) value : 254 uint64 Integer 592 (2-byte array) value : 592 uint64 Integer 67306064 (4-byte array) value : 67306064 uint64
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) Parent() IAdaValue SetStringValue(string) SetValue(interface{}) error StoreBuffer(*BufferHelper, *BufferOption) error // Int32 convert current Adabas value into integer value if possible, if not fill error Int8() (int8, error) UInt8() (uint8, error) Int16() (int16, error) UInt16() (uint16, 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 Platform() *Platform // 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{}) Errorf(format string, args ...interface{}) Fatal(args ...interface{}) }
Log defines the log interface to manage other Log output frameworks
type PartialValue ¶ added in v1.7.1
type PartialValue interface {
SetPartial(x, y uint32)
}
PartialValue partial value definition
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 RedefinitionType ¶ added in v1.7.1
type RedefinitionType struct { CommonType MainType IAdaType SubTypes []IAdaType }
RedefinitionType creates a new redefinition type
func NewRedefinitionType ¶ added in v1.7.1
func NewRedefinitionType(mainType IAdaType) *RedefinitionType
NewRedefinitionType Creates a new object of redefootopm types
func (*RedefinitionType) AddSubType ¶ added in v1.7.1
func (adaType *RedefinitionType) AddSubType(subType IAdaType)
AddSubType add redefinition sub types used for the field
func (*RedefinitionType) FormatType ¶ added in v1.7.1
func (adaType *RedefinitionType) FormatType() rune
FormatType get format type
func (*RedefinitionType) Fractional ¶ added in v1.7.1
func (adaType *RedefinitionType) Fractional() uint32
Fractional get fractional part
func (*RedefinitionType) IsStructure ¶ added in v1.7.1
func (adaType *RedefinitionType) IsStructure() bool
IsStructure return if it is an structure
func (*RedefinitionType) Length ¶ added in v1.7.1
func (adaType *RedefinitionType) Length() uint32
Length return the length of the field
func (*RedefinitionType) Option ¶ added in v1.7.1
func (adaType *RedefinitionType) Option() string
Option output all options of a field in an string
func (*RedefinitionType) SetFormatLength ¶ added in v1.7.1
func (adaType *RedefinitionType) SetFormatLength(x uint32)
SetFormatLength set format length
func (*RedefinitionType) SetFormatType ¶ added in v1.7.1
func (adaType *RedefinitionType) SetFormatType(x rune)
SetFormatType set format type
func (*RedefinitionType) SetFractional ¶ added in v1.7.1
func (adaType *RedefinitionType) SetFractional(x uint32)
SetFractional set fractional part
func (*RedefinitionType) SetLength ¶ added in v1.7.1
func (adaType *RedefinitionType) SetLength(length uint32)
SetLength set the length of the field
func (*RedefinitionType) String ¶ added in v1.7.1
func (adaType *RedefinitionType) String() string
String return the name of the field
func (*RedefinitionType) Traverse ¶ added in v1.7.1
func (adaType *RedefinitionType) Traverse(t TraverserMethods, level int, x interface{}) (err error)
Traverse Traverse through the definition tree calling a callback method for each node
func (*RedefinitionType) Value ¶ added in v1.7.1
func (adaType *RedefinitionType) Value() (adaValue IAdaValue, err error)
Value return type specific value structure object
type RedefinitionValue ¶ added in v1.7.1
type RedefinitionValue struct {
// contains filtered or unexported fields
}
RedefinitionValue redefinition value struct
func (*RedefinitionValue) Bytes ¶ added in v1.7.1
func (value *RedefinitionValue) Bytes() []byte
Bytes byte array representation of the value
func (*RedefinitionValue) Float ¶ added in v1.7.1
func (value *RedefinitionValue) Float() (float64, error)
Float floating representation
func (*RedefinitionValue) FormatBuffer ¶ added in v1.7.1
func (value *RedefinitionValue) FormatBuffer(buffer *bytes.Buffer, option *BufferOption) uint32
FormatBuffer provide the format buffer of this structure
func (*RedefinitionValue) Int16 ¶ added in v1.7.1
func (value *RedefinitionValue) Int16() (int16, error)
Int16 integer representation
func (*RedefinitionValue) Int32 ¶ added in v1.7.1
func (value *RedefinitionValue) Int32() (int32, error)
Int32 integer representation
func (*RedefinitionValue) Int64 ¶ added in v1.7.1
func (value *RedefinitionValue) Int64() (int64, error)
Int64 integer 64Bit representation
func (*RedefinitionValue) Int8 ¶ added in v1.7.1
func (value *RedefinitionValue) Int8() (int8, error)
Int8 integer representation
func (RedefinitionValue) MultipleIndex ¶ added in v1.7.1
func (adavalue RedefinitionValue) MultipleIndex() uint32
func (*RedefinitionValue) Parent ¶ added in v1.7.1
func (adavalue *RedefinitionValue) Parent() IAdaValue
func (*RedefinitionValue) PeriodIndex ¶ added in v1.7.1
func (adavalue *RedefinitionValue) PeriodIndex() uint32
func (*RedefinitionValue) SetParent ¶ added in v1.7.1
func (adavalue *RedefinitionValue) SetParent(parentAdaValue IAdaValue)
func (*RedefinitionValue) SetStringValue ¶ added in v1.7.1
func (value *RedefinitionValue) SetStringValue(stValue string)
SetStringValue set string value of redefinition
func (*RedefinitionValue) SetValue ¶ added in v1.7.1
func (value *RedefinitionValue) SetValue(v interface{}) error
SetValue set value for structure
func (*RedefinitionValue) StoreBuffer ¶ added in v1.7.1
func (value *RedefinitionValue) StoreBuffer(helper *BufferHelper, option *BufferOption) error
StoreBuffer store buffer format generator
func (*RedefinitionValue) String ¶ added in v1.7.1
func (value *RedefinitionValue) String() string
String string representation of redefinition
func (*RedefinitionValue) Traverse ¶ added in v1.7.1
func (value *RedefinitionValue) Traverse(t TraverserValuesMethods, x interface{}) (ret TraverseResult, err error)
Traverse traverse redefinition fields
func (*RedefinitionValue) UInt16 ¶ added in v1.7.1
func (value *RedefinitionValue) UInt16() (uint16, error)
UInt16 unsigned integer representation
func (*RedefinitionValue) UInt32 ¶ added in v1.7.1
func (value *RedefinitionValue) UInt32() (uint32, error)
UInt32 unsigned integer representation
func (*RedefinitionValue) UInt64 ¶ added in v1.7.1
func (value *RedefinitionValue) UInt64() (uint64, error)
UInt64 unsigned integer 64Bit represenation
func (*RedefinitionValue) UInt8 ¶ added in v1.7.1
func (value *RedefinitionValue) UInt8() (uint8, error)
UInt8 unsigned integer representation
func (*RedefinitionValue) Value ¶ added in v1.7.1
func (value *RedefinitionValue) Value() interface{}
Value return the values of an structure value
type Request ¶ added in v1.1.1
type Request struct { Caller IAdaCallInterface FormatBuffer bytes.Buffer RecordBuffer *BufferHelper MultifetchBuffer *BufferHelper RecordBufferLength uint32 RecordBufferShift uint32 PeriodLength uint32 SearchTree *SearchTree Parser RequestParser HoldRecords HoldType Limit uint64 Multifetch uint32 Descriptors []string Definition *Definition Response uint16 CmdCode [2]byte IsnIncrease bool StoreIsn bool DescriptorRead bool CbIsn Isn Isn Isn IsnQuantity uint64 IsnLowerLimit uint64 Option *BufferOption Parameter interface{} Reference string DataType *DynamicInterface PartialLobSize uint32 }
Request contains all relevant buffer and parameters for a Adabas call
func (*Request) ParseBuffer ¶ added in v1.7.1
func (adabasRequest *Request) ParseBuffer(count *uint64, x interface{}) (responseCode uint32, err error)
ParseBuffer parse given record buffer and multifetch buffer and put all data into the given definition value tree, corresponding to the field definition of the concurrent field
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) Platform ¶ added in v1.7.1
func (node *SearchNode) Platform() *Platform
Platform returns current os platform
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) Platform ¶ added in v1.7.1
func (tree *SearchTree) Platform() *Platform
Platform returns current os platform
func (*SearchTree) SearchBuffer ¶
func (tree *SearchTree) SearchBuffer() []byte
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) Platform ¶ added in v1.7.1
func (value *SearchValue) Platform() *Platform
Platform returns current os platform
func (*SearchValue) String ¶
func (value *SearchValue) String() string
String shows the current value of the search value
type SecondCall ¶ added in v1.7.1
type SecondCall uint32
SecondCall second call enum
const ( // NoneSecond No second call NoneSecond SecondCall = iota // ReadSecond Read call for second ReadSecond // StoreSecond Write call for second StoreSecond )
type Stack ¶
type Stack struct { Size int // contains filtered or unexported fields }
Stack stack creates structure
type StructureTraverser ¶ added in v1.7.1
type StructureTraverser interface {
Traverse(t TraverserMethods, level int, x interface{}) (err error)
}
StructureTraverser structure traverser interface
type StructureType ¶
type StructureType struct { CommonType // 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) FormatType ¶ added in v1.7.1
func (adaType *StructureType) FormatType() rune
FormatType get format type
func (*StructureType) Fractional ¶ added in v1.7.1
func (adaType *StructureType) Fractional() uint32
Fractional get fractional part
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) ReplaceType ¶ added in v1.7.1
func (adaType *StructureType) ReplaceType(orgType, newType IAdaType) error
ReplaceType replace type in the substructure
func (*StructureType) SetFormatLength ¶ added in v1.7.1
func (adaType *StructureType) SetFormatLength(x uint32)
SetFormatLength set format length
func (*StructureType) SetFormatType ¶ added in v1.7.1
func (adaType *StructureType) SetFormatType(x rune)
SetFormatType set format type
func (*StructureType) SetFractional ¶ added in v1.7.1
func (adaType *StructureType) SetFractional(x uint32)
SetFractional set fractional part
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) Int16 ¶ added in v1.7.1
func (value *StructureValue) Int16() (int16, error)
Int16 not used
func (*StructureValue) Int8 ¶ added in v1.7.1
func (value *StructureValue) Int8() (int8, error)
Int8 not used
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, option *BufferOption) 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) UInt16 ¶ added in v1.7.1
func (value *StructureValue) UInt16() (uint16, error)
UInt16 not used
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) UInt8 ¶ added in v1.7.1
func (value *StructureValue) UInt8() (uint8, error)
UInt8 not used
func (*StructureValue) Value ¶
func (value *StructureValue) Value() interface{}
Value return the values of an structure value
type StructureValueTraverser ¶ added in v1.7.1
type StructureValueTraverser interface {
Traverse(t TraverserValuesMethods, x interface{}) (ret TraverseResult, err error)
}
StructureValueTraverser structure value traverser
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 { CreateValues bool PrepareFunction PrepareTraverser EnterFunction TraverserValues LeaveFunction TraverserValues ElementFunction ElementTraverser }
TraverserValuesMethods structure for Traverser values
type UnicodeConverter ¶ added in v1.7.1
type UnicodeConverter struct {
// contains filtered or unexported fields
}
UnicodeConverter unicode converter
func NewUnicodeConverter ¶ added in v1.7.1
func NewUnicodeConverter(name string) *UnicodeConverter
NewUnicodeConverter new unicode converter
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
- charsets.go
- collation_value.go
- common.go
- common_type.go
- def_traverser.go
- definition.go
- definition_cache.go
- definition_interface.go
- definition_restrict.go
- definition_search.go
- definition_treecopy.go
- descriptor_type.go
- doc.go
- double_value.go
- dynamic_interface.go
- float_value.go
- int2_value.go
- int4_value.go
- int8_value.go
- length_value.go
- messages.go
- packed_value.go
- phonetic_value.go
- platform.go
- range.go
- redefinition_value.go
- referential_value.go
- search_tree.go
- stack.go
- static_messages.go
- string_value.go
- structure_type.go
- structure_value.go
- superdesc_value.go
- type.go
- unicode_value.go
- unpacked_value.go