parser

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "parser"

Type of the entity.

Variables

This section is empty.

Functions

This section is empty.

Types

type IParser

type IParser interface {
	// Read content and return a map of values.
	Read(ctx context.Context, content io.Reader) (map[string]any, error)
}

IParser defines what a Parser should do.

type Parser

type Parser struct {
	// Logger is parser's logger.
	Logger *logging.Logger `json:"-" validate:"required"`

	// Name is the name of the parser.
	Name string `json:"name" validate:"required,gte=3,lte=50"`
}

Parser is able to read a content and return a map of values.

func New

func New(name string) (*Parser, error)

New creates a new converter.

Jump to

Keyboard shortcuts

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