d2file

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckD2FileErr

func CheckD2FileErr(d2file *D2File, err error)

CheckD2FileErr checks for an error and logs it

func WriteD2File

func WriteD2File(d2file *D2File, filePath string)

WriteD2File writes the given d2File

func WriteFiles

func WriteFiles(d2files D2Files, outDir string)

WriteFiles writes all d2 files

Types

type D2File

type D2File struct {
	FileName string     `json:"filename,omitempty"`
	Headers  []string   `json:"headers,omitempty"`
	Rows     [][]string `json:"records,omitempty"`
}

D2File is a struct holding all the d2 file data

func GetOrCreateFile

func GetOrCreateFile(dataDir string, d2files D2Files, filename string) *D2File

GetOrCreateFile returns the D2File at the given key otherwise creates it

func ReadD2File

func ReadD2File(fname string, filePath string) (*D2File, error)

ReadD2File reads a given d2 file

type D2Files

type D2Files = map[string]*D2File

D2Files is a map[string]D2File

Jump to

Keyboard shortcuts

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