Documentation
¶
Index ¶
- Constants
- Variables
- func CopyPtr[T any](t *T) *T
- func CreateArrayContext(ctx context.Context, numItems int, curItem int) context.Context
- func DeepCopy[T Copyable](copyable Copyable) T
- func DeepCopySlice[I any, O any](in []I) (out []O)
- func DeepCopySliceWithConverter[I any, O any](in []I, converter func(I) O) (out []O)
- func Dump(data []byte, highlights ...int) string
- func DumpAnything(anything any, options ...func(*BoxOptions)) string
- func DumpFixedWidth(data []byte, desiredCharWidth int, highlights ...int) string
- func GenerateId(numBytes int) string
- func GetCurItemFromContext(ctx context.Context) int
- func GetLastItemFromContext(ctx context.Context) bool
- func GetNumItemsFromContext(ctx context.Context) int
- func GetSubgroupMatches(r *regexp.Regexp, query string) map[string]string
- func InlineIf[T any](test bool, a func() T, b func() T) T
- func IsNil(v any) bool
- func PlcValueUint8ListToByteArray(value values.PlcValue) []byte
- func RandomString(length int) string
- func StopWarn(localLog zerolog.Logger, opts ...func(*stopWarnOptions)) func()
- func StrToBool(str string) (bool, error)
- func StrToInt32(str string) (int32, error)
- func StrToString(s string) (string, error)
- func StrToUint8(str string) (uint8, error)
- func StrToUint16(str string) (uint16, error)
- func StrToUint32(str string) (uint32, error)
- func WithAsciiBoxBoxSet(boxSet BoxSet) func(*BoxOptions)
- func WithAsciiBoxCharWidth(charWidth int) func(*BoxOptions)
- func WithAsciiBoxFooter(footer string) func(*BoxOptions)
- func WithAsciiBoxHeader(header string) func(*BoxOptions)
- func WithAsciiBoxName(name string) func(*BoxOptions)
- func WithAsciiBoxOptions(boxOptions BoxOptions) func(*BoxOptions)
- func WithAsciiBoxWriterDefaultBoxSet(boxSet BoxSet) func(*asciiBoxWriter)
- func WithAsciiBoxWriterDefaultColoredBoxes(nameColor, headerColor, footerColor *color.Color) func(*asciiBoxWriter)
- func WithAsciiBoxWriterDisableColoredBoxes() func(*asciiBoxWriter)
- func WithJsonWriteBufferDefaultIdent(defaultIndent bool) func(*jsonWriteBuffer)
- func WithJsonWriteBufferIdent(indent string) func(*jsonWriteBuffer)
- func WithJsonWriteBufferRenderAttr(renderAttr bool) func(*jsonWriteBuffer)
- func WithStopWarnExtraSkipOffset(offset int) func(*stopWarnOptions)
- func WithStopWarnIncludeGoroutinesStack() func(*stopWarnOptions)
- func WithStopWarnInterval(interval time.Duration) func(*stopWarnOptions)
- func WithStopWarnProcessId(processId string) func(*stopWarnOptions)
- func WithStopWarnProcessInfo(processInfo string) func(*stopWarnOptions)
- func WithWriteBufferBoxBasedAsciiBoxWriter(writer AsciiBoxWriter) func(*boxedWriteBuffer)
- func WithWriteBufferBoxBasedAsciiBoxWriterLight(writer AsciiBoxWriter) func(*boxedWriteBuffer)
- func WithWriteBufferBoxBasedDesiredWidth(width int) func(*boxedWriteBuffer)
- func WithWriteBufferBoxBasedMergeSingleBoxes() func(*boxedWriteBuffer)
- func WithWriteBufferBoxBasedOmitEmptyBoxes() func(*boxedWriteBuffer)
- func WithWriteBufferBoxBasedPrintPosLengthFooter() func(*boxedWriteBuffer)
- func WithXmlWriteBufferDefaultIdent(defaultIndent bool) func(*xmlWriteBuffer)
- func WithXmlWriteBufferIdent(indent string) func(*xmlWriteBuffer)
- func WithXmlWriteBufferRenderAttr(renderAttr bool) func(*xmlWriteBuffer)
- func WithXmlWriteBufferRenderLists(renderLists bool) func(*xmlWriteBuffer)
- type AlternateStringer
- type AsciiBox
- func (m AsciiBox) ChangeBoxFooter(newFooter string) AsciiBox
- func (m AsciiBox) ChangeBoxHeader(newHeader string) AsciiBox
- func (m AsciiBox) ChangeBoxName(newName string) AsciiBox
- func (m AsciiBox) GetBoxName() string
- func (m AsciiBox) Height() int
- func (m AsciiBox) IsEmpty() bool
- func (m AsciiBox) Lines() []string
- func (m AsciiBox) String() string
- func (m AsciiBox) Width() int
- type AsciiBoxWriter
- type AsciiBoxer
- type BoxOptions
- type BoxSet
- type BufferCommons
- func (b BufferCommons) ExtractAdditionalStringRepresentation(readerWriterArgs ...WithReaderWriterArgs) string
- func (b BufferCommons) ExtractEncoding(readerWriterArgs ...WithReaderWriterArgs) string
- func (b BufferCommons) IsToBeRenderedAsList(readerWriterArgs ...WithReaderWriterArgs) bool
- func (b BufferCommons) SanitizeLogicalName(logicalName string) string
- type ByteOrderAware
- type Copyable
- type CustomOption
- type ErrorIdentify
- type LengthAware
- type ParseAssertError
- type ParseValidationError
- type PlcValuedeprecated
- type PositionAware
- type ReadBuffer
- type ReadBufferByteBased
- type ReadBufferByteBasedOptions
- type Serializable
- type Stack
- type TimeoutError
- type WithReaderArgs
- type WithReaderWriterArgs
- func UpcastReaderArgs(args ...WithReaderArgs) []WithReaderWriterArgs
- func UpcastWriterArgs(args ...WithWriterArgs) []WithReaderWriterArgs
- func WithAdditionalStringRepresentation(stringRepresentation string) WithReaderWriterArgs
- func WithEncoding(encoding string) WithReaderWriterArgs
- func WithRenderAsList(renderAsList bool) WithReaderWriterArgs
- type WithWriterArgs
- type WriteBuffer
- type WriteBufferBoxBased
- type WriteBufferByteBased
- type WriteBufferByteBasedOptions
- type WriteBufferJsonBased
- type WriteBufferXmlBased
Constants ¶
const DefaultWidth = 46 // 10 bytes per line on a []byte < 999
DefaultWidth defaults to a default screen dumps size
Variables ¶
var ANSI_PATTERN = regexp.MustCompile("[\u001b\u009b][\\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]")
ANSI_PATTERN source: https://github.com/chalk/ansi-regex/blob/main/index.js#L3
var AsciiBoxLogger zerolog.Logger
var AsciiBoxWriterDefault = NewAsciiBoxWriter()
var AsciiBoxWriterLight = NewAsciiBoxWriter(WithAsciiBoxWriterDefaultBoxSet(DefaultLightBoxSet()))
var DebugAsciiBox bool
DebugAsciiBox set to true to get debug messages
var DebugHex bool
DebugHex set to true to get debug messages
Functions ¶
func CreateArrayContext ¶
CreateArrayContext creates a new context, which contains information on the size and the current position in the array.
func DeepCopySlice ¶
DeepCopySlice copies as slice into a new one. Note: if slice contains pointer use DeepCopySliceWithConverter in combination with ToPtr
func DeepCopySliceWithConverter ¶
DeepCopySliceWithConverter copies as slice into a new one using converter for transformation
func DumpAnything ¶
func DumpAnything(anything any, options ...func(*BoxOptions)) string
DumpAnything dumps anything as hex
func DumpFixedWidth ¶
DumpFixedWidth dumps hex as hex string. The minimum width of string returned is 18 up to supplied charWidth
func GenerateId ¶
func GetCurItemFromContext ¶
GetCurItemFromContext helper to get access to the curItem value stored in the context.
func GetLastItemFromContext ¶
GetLastItemFromContext helper to get access to the lastItem value which is calculated from data stored in the context.
func GetNumItemsFromContext ¶
GetNumItemsFromContext helper to get access to the numItems value stored in the context.
func RandomString ¶
RandomString returns a random string using the alphabet
func StopWarn ¶
StopWarn gives out warning every interval (default 5 seconds) when a function doesn't terminate. Usage: `defer StopWarn(log)()`
func StrToInt32 ¶
func StrToString ¶
func StrToUint8 ¶
func StrToUint16 ¶
func StrToUint32 ¶
func WithAsciiBoxBoxSet ¶
func WithAsciiBoxBoxSet(boxSet BoxSet) func(*BoxOptions)
func WithAsciiBoxCharWidth ¶
func WithAsciiBoxCharWidth(charWidth int) func(*BoxOptions)
func WithAsciiBoxFooter ¶
func WithAsciiBoxFooter(footer string) func(*BoxOptions)
func WithAsciiBoxHeader ¶
func WithAsciiBoxHeader(header string) func(*BoxOptions)
func WithAsciiBoxName ¶
func WithAsciiBoxName(name string) func(*BoxOptions)
func WithAsciiBoxOptions ¶
func WithAsciiBoxOptions(boxOptions BoxOptions) func(*BoxOptions)
func WithAsciiBoxWriterDefaultBoxSet ¶
func WithAsciiBoxWriterDefaultBoxSet(boxSet BoxSet) func(*asciiBoxWriter)
func WithAsciiBoxWriterDisableColoredBoxes ¶
func WithAsciiBoxWriterDisableColoredBoxes() func(*asciiBoxWriter)
func WithJsonWriteBufferDefaultIdent ¶
func WithJsonWriteBufferDefaultIdent(defaultIndent bool) func(*jsonWriteBuffer)
WithJsonWriteBufferDefaultIdent configures the jsonWriteBuffer to use default indentation
func WithJsonWriteBufferIdent ¶
func WithJsonWriteBufferIdent(indent string) func(*jsonWriteBuffer)
WithJsonWriteBufferIdent configures the jsonWriteBuffer to use the given indentation
func WithJsonWriteBufferRenderAttr ¶
func WithJsonWriteBufferRenderAttr(renderAttr bool) func(*jsonWriteBuffer)
WithJsonWriteBufferRenderAttr configures the jsonWriteBuffer to render attributes
func WithStopWarnExtraSkipOffset ¶
func WithStopWarnExtraSkipOffset(offset int) func(*stopWarnOptions)
WithStopWarnExtraSkipOffset sets an extra offset for the skip. Skip uses 1 so if you want to have 0 use -1 as arg.
func WithStopWarnIncludeGoroutinesStack ¶
func WithStopWarnIncludeGoroutinesStack() func(*stopWarnOptions)
WithStopWarnIncludeGoroutinesStack is a flag which instructs the warn log to include the list of all current goroutines
func WithStopWarnInterval ¶
WithStopWarnInterval sets the interval at which a warning is logged (default 5 seconds). MUST be greater 0.
func WithStopWarnProcessId ¶
func WithStopWarnProcessId(processId string) func(*stopWarnOptions)
WithStopWarnProcessId sets a process id which will be prefixed to the message
func WithStopWarnProcessInfo ¶
func WithStopWarnProcessInfo(processInfo string) func(*stopWarnOptions)
WithStopWarnProcessInfo set the processInfo
func WithWriteBufferBoxBasedAsciiBoxWriter ¶
func WithWriteBufferBoxBasedAsciiBoxWriter(writer AsciiBoxWriter) func(*boxedWriteBuffer)
WithWriteBufferBoxBasedAsciiBoxWriter sets the AsciiBoxWriter to use for rendering the output.
func WithWriteBufferBoxBasedAsciiBoxWriterLight ¶
func WithWriteBufferBoxBasedAsciiBoxWriterLight(writer AsciiBoxWriter) func(*boxedWriteBuffer)
WithWriteBufferBoxBasedAsciiBoxWriterLight sets the AsciiBoxWriter to use for rendering the light output.
func WithWriteBufferBoxBasedDesiredWidth ¶
func WithWriteBufferBoxBasedDesiredWidth(width int) func(*boxedWriteBuffer)
WithWriteBufferBoxBasedDesiredWidth sets the desired width of the output. If the output exceeds this width, it will be wrapped.
func WithWriteBufferBoxBasedMergeSingleBoxes ¶
func WithWriteBufferBoxBasedMergeSingleBoxes() func(*boxedWriteBuffer)
func WithWriteBufferBoxBasedOmitEmptyBoxes ¶
func WithWriteBufferBoxBasedOmitEmptyBoxes() func(*boxedWriteBuffer)
func WithWriteBufferBoxBasedPrintPosLengthFooter ¶
func WithWriteBufferBoxBasedPrintPosLengthFooter() func(*boxedWriteBuffer)
WithWriteBufferBoxBasedPrintPosLengthFooter enables printing the position and length of the current box at the end of the box.
func WithXmlWriteBufferDefaultIdent ¶
func WithXmlWriteBufferDefaultIdent(defaultIndent bool) func(*xmlWriteBuffer)
WithXmlWriteBufferDefaultIdent configures the xmlWriteBuffer to use default indentation
func WithXmlWriteBufferIdent ¶
func WithXmlWriteBufferIdent(indent string) func(*xmlWriteBuffer)
WithXmlWriteBufferIdent configures the xmlWriteBuffer to use the given indentation
func WithXmlWriteBufferRenderAttr ¶
func WithXmlWriteBufferRenderAttr(renderAttr bool) func(*xmlWriteBuffer)
WithXmlWriteBufferRenderAttr configures the xmlWriteBuffer to render attributes
func WithXmlWriteBufferRenderLists ¶
func WithXmlWriteBufferRenderLists(renderLists bool) func(*xmlWriteBuffer)
WithXmlWriteBufferRenderLists configures the xmlWriteBuffer to render lists
Types ¶
type AlternateStringer ¶
AlternateStringer can be implemented by stuff using the generator to give an alternate fmt.Stringer representation
type AsciiBox ¶
type AsciiBox struct {
// contains filtered or unexported fields
}
AsciiBox is a string surrounded by an ascii border (and an optional name)
func BoxAnything ¶
func BoxAnything(anything any, options ...func(*BoxOptions)) AsciiBox
func BoxedDump ¶
func BoxedDump(data []byte, options ...func(*BoxOptions)) AsciiBox
BoxedDump dumps a 56+2 char wide hex string
func BoxedDumpAnything ¶
func BoxedDumpAnything(anything any, options ...func(*BoxOptions)) AsciiBox
BoxedDumpAnything dumps anything as hex into a beautiful box
func (AsciiBox) ChangeBoxFooter ¶
func (AsciiBox) ChangeBoxHeader ¶
func (AsciiBox) ChangeBoxName ¶
func (AsciiBox) GetBoxName ¶
type AsciiBoxWriter ¶
type AsciiBoxWriter interface {
BoxBox(box AsciiBox, options ...func(*BoxOptions)) AsciiBox
BoxString(data string, options ...func(*BoxOptions)) AsciiBox
AlignBoxes(asciiBoxes []AsciiBox, desiredWith int, options ...func(*BoxOptions)) AsciiBox
BoxSideBySide(box1 AsciiBox, box2 AsciiBox, options ...func(*BoxOptions)) AsciiBox
BoxBelowBox(box1 AsciiBox, box2 AsciiBox, options ...func(*BoxOptions)) AsciiBox
}
func NewAsciiBoxWriter ¶
func NewAsciiBoxWriter(opts ...func(writer *asciiBoxWriter)) AsciiBoxWriter
type AsciiBoxer ¶
type AsciiBoxer interface {
// Box with options
Box(...func(*BoxOptions)) AsciiBox
}
AsciiBoxer is used to render something in a box
type BoxOptions ¶
type BoxSet ¶
type BoxSet struct {
UpperLeftCorner string
UpperRightCorner string
HorizontalLine string
VerticalLine string
LowerLeftCorner string
LowerRightCorner string
}
func DefaultBoxSet ¶
func DefaultBoxSet() BoxSet
func DefaultLightBoxSet ¶
func DefaultLightBoxSet() BoxSet
type BufferCommons ¶
type BufferCommons struct {
}
func (BufferCommons) ExtractAdditionalStringRepresentation ¶
func (b BufferCommons) ExtractAdditionalStringRepresentation(readerWriterArgs ...WithReaderWriterArgs) string
func (BufferCommons) ExtractEncoding ¶
func (b BufferCommons) ExtractEncoding(readerWriterArgs ...WithReaderWriterArgs) string
func (BufferCommons) IsToBeRenderedAsList ¶
func (b BufferCommons) IsToBeRenderedAsList(readerWriterArgs ...WithReaderWriterArgs) bool
func (BufferCommons) SanitizeLogicalName ¶
func (b BufferCommons) SanitizeLogicalName(logicalName string) string
type ByteOrderAware ¶
type CustomOption ¶
type CustomOption struct {
// contains filtered or unexported fields
}
CustomOption can be used for transporting custom readerWriterArgs. Use NewCustomOption to create one.
func NewCustomOption ¶
func NewCustomOption() CustomOption
type ErrorIdentify ¶
ErrorIdentify is an interface defining the inline interface defined in errors.Is(err, target error) bool (wrap.go)
type LengthAware ¶
type ParseAssertError ¶
func (ParseAssertError) Error ¶
func (e ParseAssertError) Error() string
func (ParseAssertError) Is ¶
func (e ParseAssertError) Is(target error) bool
type ParseValidationError ¶
type ParseValidationError struct {
Message string
}
func (ParseValidationError) Error ¶
func (e ParseValidationError) Error() string
func (ParseValidationError) Is ¶
func (e ParseValidationError) Is(target error) bool
type PositionAware ¶
type PositionAware interface {
// GetPos return the current byte position
GetPos() uint16
}
type ReadBuffer ¶
type ReadBuffer interface {
PositionAware
ByteOrderAware
// Reset sets the position to the supplied byte position
Reset(pos uint16)
// HasMore returns true if there are bitLength bits available
HasMore(bitLength uint8) bool
// PullContext signals that we expect now a context with the supplied logical name
PullContext(logicalName string, readerArgs ...WithReaderArgs) error
ReadBit(logicalName string, readerArgs ...WithReaderArgs) (bool, error)
ReadByte(logicalName string, readerArgs ...WithReaderArgs) (byte, error)
ReadByteArray(logicalName string, numberOfBytes int, readerArgs ...WithReaderArgs) ([]byte, error)
ReadUint8(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (uint8, error)
ReadUint16(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (uint16, error)
ReadUint32(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (uint32, error)
ReadUint64(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (uint64, error)
ReadInt8(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (int8, error)
ReadInt16(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (int16, error)
ReadInt32(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (int32, error)
ReadInt64(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (int64, error)
ReadBigInt(logicalName string, bitLength uint64, readerArgs ...WithReaderArgs) (*big.Int, error)
ReadFloat32(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (float32, error)
ReadFloat64(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (float64, error)
ReadBigFloat(logicalName string, bitLength uint8, readerArgs ...WithReaderArgs) (*big.Float, error)
ReadString(logicalName string, bitLength uint32, readerArgs ...WithReaderArgs) (string, error)
// CloseContext signals that we expect the end of the context with the supplied logical name
CloseContext(logicalName string, readerArgs ...WithReaderArgs) error
}
func NewJsonReadBuffer ¶
func NewJsonReadBuffer(reader io.Reader) ReadBuffer
NewJsonReadBuffer return as ReadBuffer which doesn't validate attributes and lists
func NewStrictJsonReadBuffer ¶
func NewStrictJsonReadBuffer(reader io.Reader, validateAttr bool) ReadBuffer
NewStrictJsonReadBuffer return as ReadBuffer which does validate attributes on the setting
func NewStrictXmlReadBuffer ¶
func NewStrictXmlReadBuffer(reader io.Reader, validateAttr bool, validateList bool) ReadBuffer
NewStrictXmlReadBuffer return as ReadBuffer which does validate attributes and lists depending on the setting
func NewXmlReadBuffer ¶
func NewXmlReadBuffer(reader io.Reader) ReadBuffer
NewXmlReadBuffer return as ReadBuffer which doesn't validate attributes and lists
type ReadBufferByteBased ¶
type ReadBufferByteBased interface {
ReadBuffer
GetBytes() []byte
GetTotalBytes() uint64
PeekByte(offset byte) byte
}
func NewReadBufferByteBased ¶
func NewReadBufferByteBased(data []byte, options ...ReadBufferByteBasedOptions) ReadBufferByteBased
type ReadBufferByteBasedOptions ¶
type ReadBufferByteBasedOptions = func(b *byteReadBuffer)
func WithByteOrderForReadBufferByteBased ¶
func WithByteOrderForReadBufferByteBased(byteOrder binary.ByteOrder) ReadBufferByteBasedOptions
type Serializable ¶
type TimeoutError ¶
type TimeoutError struct {
// contains filtered or unexported fields
}
func NewTimeoutError ¶
func NewTimeoutError(timeout time.Duration) TimeoutError
func (TimeoutError) Error ¶
func (t TimeoutError) Error() string
func (TimeoutError) Is ¶
func (t TimeoutError) Is(target error) bool
type WithReaderArgs ¶
type WithReaderArgs interface {
// contains filtered or unexported methods
}
WithReaderArgs is a marker interface for reader args supplied by the builders
type WithReaderWriterArgs ¶
type WithReaderWriterArgs interface {
WithReaderArgs
WithWriterArgs
}
WithReaderWriterArgs is a marker interface for reader args supplied by the builders
func UpcastReaderArgs ¶
func UpcastReaderArgs(args ...WithReaderArgs) []WithReaderWriterArgs
func UpcastWriterArgs ¶
func UpcastWriterArgs(args ...WithWriterArgs) []WithReaderWriterArgs
func WithAdditionalStringRepresentation ¶
func WithAdditionalStringRepresentation(stringRepresentation string) WithReaderWriterArgs
WithAdditionalStringRepresentation can be used by e.g. enums to supply an additional string representation
func WithEncoding ¶
func WithEncoding(encoding string) WithReaderWriterArgs
WithEncoding specifies an encoding
func WithRenderAsList ¶
func WithRenderAsList(renderAsList bool) WithReaderWriterArgs
WithRenderAsList indicates that an element can be rendered as list
type WithWriterArgs ¶
type WithWriterArgs interface {
// contains filtered or unexported methods
}
WithWriterArgs is a marker interface for writer args supplied by the builders like WithAdditionalStringRepresentation
type WriteBuffer ¶
type WriteBuffer interface {
PositionAware
ByteOrderAware
// PushContext signals opening context with the supplied logical name
PushContext(logicalName string, writerArgs ...WithWriterArgs) error
WriteBit(logicalName string, value bool, writerArgs ...WithWriterArgs) error
WriteByte(logicalName string, value byte, writerArgs ...WithWriterArgs) error
WriteByteArray(logicalName string, data []byte, writerArgs ...WithWriterArgs) error
WriteUint8(logicalName string, bitLength uint8, value uint8, writerArgs ...WithWriterArgs) error
WriteUint16(logicalName string, bitLength uint8, value uint16, writerArgs ...WithWriterArgs) error
WriteUint32(logicalName string, bitLength uint8, value uint32, writerArgs ...WithWriterArgs) error
WriteUint64(logicalName string, bitLength uint8, value uint64, writerArgs ...WithWriterArgs) error
WriteInt8(logicalName string, bitLength uint8, value int8, writerArgs ...WithWriterArgs) error
WriteInt16(logicalName string, bitLength uint8, value int16, writerArgs ...WithWriterArgs) error
WriteInt32(logicalName string, bitLength uint8, value int32, writerArgs ...WithWriterArgs) error
WriteInt64(logicalName string, bitLength uint8, value int64, writerArgs ...WithWriterArgs) error
WriteBigInt(logicalName string, bitLength uint8, value *big.Int, writerArgs ...WithWriterArgs) error
WriteFloat32(logicalName string, bitLength uint8, value float32, writerArgs ...WithWriterArgs) error
WriteFloat64(logicalName string, bitLength uint8, value float64, writerArgs ...WithWriterArgs) error
WriteBigFloat(logicalName string, bitLength uint8, value *big.Float, writerArgs ...WithWriterArgs) error
WriteString(logicalName string, bitLength uint32, value string, writerArgs ...WithWriterArgs) error
WriteVirtual(ctx context.Context, logicalName string, value any, writerArgs ...WithWriterArgs) error
WriteSerializable(ctx context.Context, serializable Serializable) error
// PopContext signals work done with the context with the supplied logical name
PopContext(logicalName string, writerArgs ...WithWriterArgs) error
}
type WriteBufferBoxBased ¶
type WriteBufferBoxBased interface {
WriteBuffer
GetBox() AsciiBox
}
func NewWriteBufferBoxBased ¶
func NewWriteBufferBoxBased(opts ...func(buffer *boxedWriteBuffer)) WriteBufferBoxBased
type WriteBufferByteBased ¶
type WriteBufferByteBased interface {
WriteBuffer
GetPos() uint16
GetBytes() []byte
GetTotalBytes() uint64
}
func NewWriteBufferByteBased ¶
func NewWriteBufferByteBased(options ...WriteBufferByteBasedOptions) WriteBufferByteBased
type WriteBufferByteBasedOptions ¶
type WriteBufferByteBasedOptions = func(b *byteWriteBuffer)
func WithByteOrderForByteBasedBuffer ¶
func WithByteOrderForByteBasedBuffer(byteOrder binary.ByteOrder) WriteBufferByteBasedOptions
func WithCustomBufferForByteBasedBuffer ¶
func WithCustomBufferForByteBasedBuffer(buffer *bytes.Buffer) WriteBufferByteBasedOptions
func WithInitialSizeForByteBasedBuffer ¶
func WithInitialSizeForByteBasedBuffer(length int) WriteBufferByteBasedOptions
type WriteBufferJsonBased ¶
type WriteBufferJsonBased interface {
WriteBuffer
GetJsonString() (string, error)
}
func NewJsonWriteBuffer ¶
func NewJsonWriteBuffer(opts ...func(*jsonWriteBuffer)) WriteBufferJsonBased
NewJsonWriteBuffer creates a new WriteBufferJsonBased with renders all information into json
type WriteBufferXmlBased ¶
type WriteBufferXmlBased interface {
WriteBuffer
GetXmlString() string
}
func NewXmlWriteBuffer ¶
func NewXmlWriteBuffer(opts ...func(*xmlWriteBuffer)) WriteBufferXmlBased
NewXmlWriteBuffer returns a WriteBufferXmlBased which renders all information into xml
Source Files
¶
- ArrayContext.go
- Buffer.go
- ByteOrderAware.go
- CastUtils.go
- Copyable.go
- Errors.go
- IdGenerator.go
- LengthAware.go
- PositionAware.go
- ReadBuffer.go
- ReadBufferByteBased.go
- ReadBufferJsonBased.go
- ReadBufferXmlBased.go
- Regexp.go
- Serializable.go
- StopWarn.go
- StringUtils.go
- WriteBuffer.go
- WriteBufferBoxBased.go
- WriteBufferByteBased.go
- WriteBufferJsonBased.go
- WriteBufferXmlBased.go
- asciiBox.go
- bufferCommons.go
- common.go
- dumpUtils.go
- hex.go
- mock_requirements.go
- options.go