package escape

import "github.com/influxdata/influxdb/pkg/escape"

Package escape contains utilities for escaping parts of InfluxQL and InfluxDB line protocol.

Index

Variables

var Codes = map[byte][]byte{
	',': []byte(`\,`),
	'"': []byte(`\"`),
	' ': []byte(`\ `),
	'=': []byte(`\=`),
}

Codes is a map of bytes to be escaped.

Functions

func AppendUnescaped

func AppendUnescaped(dst, src []byte) []byte

AppendUnescaped appends the unescaped version of src to dst and returns the resulting slice.

func Bytes

func Bytes(in []byte) []byte

Bytes escapes characters on the input slice, as defined by Codes.

func IsEscaped

func IsEscaped(b []byte) bool

IsEscaped returns whether b has any escaped characters, i.e. whether b seems to have been processed by Bytes.

func String

func String(in string) string

String returns the escaped version of in.

func Unescape

func Unescape(in []byte) []byte

Unescape returns a new slice containing the unescaped version of in.

func UnescapeString

func UnescapeString(in string) string

UnescapeString returns unescaped version of in.

Source Files

bytes.go strings.go

Version
v1.12.0 (latest)
Published
Apr 8, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
2 days ago

Tools for package owners.