package escape

import "github.com/influxdata/influxdb1-client/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
v0.0.0-20220302092344-a9ab5670611c (latest)
Published
Mar 2, 2022
Platform
linux/amd64
Imports
2 packages
Last checked
1 month ago

Tools for package owners.