Documentation
¶
Index ¶
- type InspectableByteString
- func (s InspectableByteString) FormatWithHighlightedOffset(highlightOffset int, highlightText string, formattedStringPrefix string, ...) string
- func (s InspectableByteString) FormattedString() string
- func (s InspectableByteString) GetOffsetInFormattedString(byteOffset int) int
- func (s InspectableByteString) TruncateAroundOffset(offset int) InspectableByteString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InspectableByteString ¶
type InspectableByteString struct {
// contains filtered or unexported fields
}
func NewInspectableByteString ¶
func NewInspectableByteString(bytes []byte) InspectableByteString
func (InspectableByteString) FormatWithHighlightedOffset ¶
func (s InspectableByteString) FormatWithHighlightedOffset(highlightOffset int, highlightText string, formattedStringPrefix string, formattedStringSuffix string) string
FormatWithHighlightedOffset returns a string that represents the bytes with the byteOffset highlighted
For example, if called with highlightOffset 4, highlightText "error" and formattedString "Received: ", the return value will be:
> Received: "+OK\r\n" > ^ error
func (InspectableByteString) FormattedString ¶
func (s InspectableByteString) FormattedString() string
func (InspectableByteString) GetOffsetInFormattedString ¶
func (s InspectableByteString) GetOffsetInFormattedString(byteOffset int) int
GetOffsetInFormattedString returns a string that represents the byteOffset in the formatted string
For example:
- If the string is "+OK\r\n"
- And byteOffset is 4 (i.e. \n, the 5th byte)
- The return value will be 6 (i.e. the 6th character in the formatted string)
func (InspectableByteString) TruncateAroundOffset ¶
func (s InspectableByteString) TruncateAroundOffset(offset int) InspectableByteString
Click to show internal directories.
Click to hide internal directories.