df

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 4 Imported by: 2

README

Go Reference

Dataformat

Package contains constants that names few commonly used data formats, like

  • JSON
  • XML
  • YAML

and functions to check whether input data with some significant probability matches given format.

Warning

Functions from that package should not be used in production code.

Documentation

Overview

Package df holds stuff related to data format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHTML

func IsHTML[i input](b i) bool

IsHTML checks whether bytes are in HTML format.

func IsJSON

func IsJSON[i input](b i) bool

IsJSON checks whether bytes are in JSON format.

func IsPlainText

func IsPlainText[i input](b i) bool

IsPlainText checks whether bytes are in plain text format.

func IsXML

func IsXML[i input](b i) bool

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

func IsYAML

func IsYAML[i input](b i) 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"
)

Pre-defined well known data formats.

Jump to

Keyboard shortcuts

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