format

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 0 Imported by: 5

Documentation

Index

Constants

View Source
const (
	UnknownExt string = ".unknown"
	JSONExt    string = ".json"
	WireExt    string = ".wire"
	TextExt    string = ".text"
	ExcelExt   string = ".xlsx"
	CSVExt     string = ".csv"
	XMLExt     string = ".xml"
)

File format extension

Variables

View Source
var InputFormats = []Format{Excel, CSV, XML}
View Source
var OutputFormats = []Format{JSON, Wire, Text}

Functions

func Amongst added in v0.9.7

func Amongst(fmt Format, formats []Format) bool

func FilterInput added in v0.9.7

func FilterInput(inputFormat Format, allowedInputFormats []Format) bool

FilterInput checks if this input format need to be converted.

func Format2Ext

func Format2Ext(fmt Format) string

func IsInputFormat added in v0.9.10

func IsInputFormat(fmt Format) bool

Types

type Format

type Format int
const (
	UnknownFormat Format = iota
	// input formats below
	Excel
	CSV
	XML
	// output formats below
	JSON
	Wire
	Text
)

File format

func Ext2Format

func Ext2Format(ext string) Format

Jump to

Keyboard shortcuts

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