Documentation ¶
Index ¶
- Constants
- Variables
- func ColumnString(prefix string, columns []zed.Column, suffix string) string
- func FormatName(name string) string
- func FormatValue(v zed.Value, fmt OutFmt) string
- func ParseBstring(in []byte) (zcode.Bytes, error)
- func ParseString(in []byte) (zcode.Bytes, error)
- func ShouldEscape(r rune, fmt OutFmt, pos int, inContainer bool) bool
- func StringOf(zv zed.Value, out OutFmt, b bool) string
- func StringOfArray(t *zed.TypeArray, zv zcode.Bytes, fmt OutFmt, _ bool) string
- func StringOfBstring(data zcode.Bytes, fmt OutFmt, inContainer bool) string
- func StringOfDuration(t *zed.TypeOfDuration, zv zcode.Bytes, _ OutFmt, _ bool) string
- func StringOfMap(t *zed.TypeMap, zv zcode.Bytes, fmt OutFmt, _ bool) string
- func StringOfNet(t *zed.TypeOfNet, zv zcode.Bytes, _ OutFmt, _ bool) string
- func StringOfRecord(t *zed.TypeRecord, zv zcode.Bytes, fmt OutFmt, _ bool) string
- func StringOfSet(t *zed.TypeSet, zv zcode.Bytes, fmt OutFmt, _ bool) string
- func StringOfString(t *zed.TypeOfString, zv zcode.Bytes, fmt OutFmt, inContainer bool) string
- func StringOfTime(t *zed.TypeOfTime, zv zcode.Bytes, _ OutFmt, _ bool) string
- func StringOfUnion(t *zed.TypeUnion, zv zcode.Bytes, ofmt OutFmt, _ bool) string
- func StringRecord(t *zed.TypeRecord) string
- func StringTypeEnum(t *zed.TypeEnum) string
- func StringTypeUnion(t *zed.TypeUnion) string
- func TypeRecordString(columns []zed.Column) string
- func TypeString(typ zed.Type) string
- func UnescapeString(data []byte) []byte
- type OutFmt
- type TypeParser
Constants ¶
const ( OutFormatUnescaped = OutFmt(iota) OutFormatZNG OutFormatZeek OutFormatZeekAscii )
Variables ¶
var ErrEmptyTypeList = errors.New("empty type list in set or union")
Functions ¶
func FormatName ¶
func ShouldEscape ¶
ShouldEscape determines if the given code point at the given position in a value should be escaped for the given output format. This function does not account for unprintable characters, its main purpose is to centralize the logic about which characters are syntatically significant in each output format and hence must be escaped. The inContainer parameter specifies whether this values is inside a set or vector (which is needed to correctly implement zeek log escaping rules).
func StringOfArray ¶
func StringOfBstring ¶
Values of type bstring may contain a mix of valid UTF-8 and arbitrary binary data. These are represented in output using the same formatting with "\x.." escapes as Zeek. In general, valid UTF-8 code points are passed through unmodified, though for the ZEEK_ASCII output format, all non-ascii bytes are escaped for compatibility with older versions of Zeek.
func StringOfDuration ¶
func StringOfRecord ¶
func StringOfString ¶
func StringOfTime ¶
func StringOfUnion ¶
func StringRecord ¶
func StringRecord(t *zed.TypeRecord) string
func StringTypeEnum ¶
func StringTypeUnion ¶
func TypeRecordString ¶
func TypeString ¶
func UnescapeString ¶
UnescapeString replaces all the escaped characters defined in the for the zng spec for the string type with their unescaped equivalents.
Types ¶
type OutFmt ¶
type OutFmt int
The fmt paramter passed to Type.StringOf() must be one of the following values, these are used to inform the formatter how containers should be encoded and what sort of escaping should be applied to string types.
type TypeParser ¶
type TypeParser struct {
// contains filtered or unexported fields
}
func NewTypeParser ¶
func NewTypeParser(zctx *zed.Context) *TypeParser