data

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(id, path string) (string, error)

func GetDocMapping

func GetDocMapping(keys map[string]string) (*mapping.DocumentMapping, error)

GetDocMapping creates a custom mapping for our DataSource structure.

Types

type Entry

type Entry struct {
	Title  string
	URL    string
	Year   int
	Author string
}

type Mapping

type Mapping struct {
	Path      string
	Template  string            // TextFSM, LOIS, etc.
	Fields    map[string]string // Key -> type
	Extension string
}

func ParseMap

func ParseMap(path string) (Mapping, error)

type Set

type Set struct {
	Sources []Source
	Mapping Mapping
}

Set represents a data set of arbitrary structure.

func FromLinkList(path string) (Set, error)

func FromMapping

func FromMapping(path string) (Set, error)

type Source

type Source struct {
	ID     string
	URL    string
	Fields interface{}
}

Source represents an arbitrary, indexable source of data: it could be a structured file (YAML, JSON, CSV, XLSX, etc.) or a free-form, plain-text file.

func FromFile

func FromFile(m Mapping) ([]Source, error)

Jump to

Keyboard shortcuts

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