parse

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package parsers houses the build-in parser functions that are registered with please

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Csv

func Csv(input []byte) (interface{}, error)

func Html

func Html(input []byte) (interface{}, error)

func Identify

func Identify(input []byte) (string, interface{}, error)

Identify tries to figure out the format of the structured data passed in If successful, the name of the detected format and a copy of its data parsed into an interface{} will be returned If the data format could not be identified, an error will be returned

func Json

func Json(input []byte) (interface{}, error)

func Mime

func Mime(input []byte) (interface{}, error)

func Names

func Names() []string

Names returns a sorted list of valid options for the "format" parameter of Parse

func Query

func Query(input []byte) (interface{}, error)

func Register

func Register(name string, parser Parser) error

Register assigns a Parser function to a name. If the name has already been registered, an error will be returned.

func Xml

func Xml(input []byte) (interface{}, error)

func Yaml

func Yaml(input []byte) (interface{}, error)

Types

type Parser

type Parser func([]byte) (interface{}, error)

Type Parser is a function that takes a byte slice and attempts to parse it into a structure format in an interface{}

func Get

func Get(name string) (Parser, error)

Get returns a Parser function by name. If the named parser is not found, an error will be returned.

Jump to

Keyboard shortcuts

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