format

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 0 Imported by: 5

Documentation

Index

Constants

View Source
const (
	UnknownExt string = ".unknown"
	// input formats
	ExcelExt string = ".xlsx"
	CSVExt   string = ".csv"
	XMLExt   string = ".xml"
	// output formats
	JSONExt string = ".json"
	BinExt  string = ".bin"
	TextExt string = ".txt"
)

File format extension

Variables

View Source
var InputFormats = []Format{Excel, CSV, XML}
View Source
var OutputFormats = []Format{JSON, Bin, 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 string
const (
	UnknownFormat Format = "unknown"
	// input formats
	Excel Format = "xlsx"
	CSV   Format = "csv"
	XML   Format = "xml"
	// output formats
	JSON Format = "json"
	Bin  Format = "bin"
	Text Format = "txt"
)

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