parsers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 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 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 Names

func Names() []string

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

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.

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