format

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHTML added in v1.2.0

func IsHTML(b []byte) bool

IsHTML checks whether bytes are in HTML format.

func IsJSON

func IsJSON(b []byte) bool

IsJSON checks whether bytes are in JSON format.

func IsPlainText added in v1.2.0

func IsPlainText(b []byte) bool

IsPlainText checks whether bytes are in plain text format.

func IsXML added in v0.13.0

func IsXML(b []byte) bool

IsXML checks whether bytes are in XML format. Function does not guarantee that standard xml.Unmarshal will work b, instead it only looks for characteristics of XML formatted data.

func IsYAML

func IsYAML(b []byte) bool

IsYAML checks whether bytes are in YAML format.

Types

type DataFormat

type DataFormat string

DataFormat describes format of data.

const (
	// JSON describes JSON data format.
	JSON DataFormat = "JSON"

	// YAML describes Yaml data format.
	YAML DataFormat = "YAML"

	// XML describes XML data format.
	XML DataFormat = "XML"

	// HTML describes HTML data format.
	HTML DataFormat = "HTML"

	// PlainText describes plan text data format.
	PlainText DataFormat = "plain text"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL