mapper

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExtensionCSDB is the file extension for CSDB files.
	ExtensionCSDB = ".csdb"
	// ExtensionCSV is the file extension for CSV files.
	ExtensionCSV = ".csv"
	// ExtensionCSVW is the file extension for CSVW files.
	ExtensionCSVW = ".csvw"
	// ExtensionSDMX is the file extension for SDMX files.
	ExtensionSDMX = ".sdmx"
	// ExtensionXLS is the file extension for Microsoft Excel XLS files.
	ExtensionXLS = ".xls"
	// ExtensionXLSX is the file extension for Microsoft Excel XLSX files.
	ExtensionXLSX = ".xlsx"
	// MimeTypeCSDB is the MIME type for CSDB files.
	MimeTypeCSDB = "application/csdb"
	// MimeTypeCSV is the MIME type for CSV files.
	MimeTypeCSV = "text/csv"
	// MimeTypeCSVW is the MIME type for CSVW files.
	MimeTypeCSVW = "application/csvw+json"
	// MimeTypeSDMX is the MIME type for SDMX files.
	MimeTypeSDMX = "application/sdmx+xml"
	// MimeTypeXLS is the MIME type for Microsoft Excel XLS files.
	MimeTypeXLS = "application/vnd.ms-excel"
	// MimeTypeXLSX is the MIME type for Microsoft Excel XLSX files.
	MimeTypeXLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
	// MimeTypeOctetStream is the generic MIME type for binary data.
	MimeTypeOctetStream = "application/octet-stream"
)

Variables

This section is empty.

Functions

func DeriveMimeTypeFromFilename added in v0.26.1

func DeriveMimeTypeFromFilename(filename string) string

DeriveMimeTypeFromFilename returns the MIME type for a given file name. If the type cannot be determined, it returns "application/octet-stream".

func MapDatasetLandingPageToDatasetAPI

func MapDatasetLandingPageToDatasetAPI(datasetID string, pageData zebedee.DatasetLandingPage) (*datasetModels.Dataset, error)

MapDatasetLandingPageToDatasetAPI maps a Zebedee dataset landing page to a Dataset API dataset model.

func MapDatasetVersionToDatasetAPI added in v0.24.0

func MapDatasetVersionToDatasetAPI(editionID string, pageData zebedee.Dataset, seriesData zebedee.DatasetLandingPage, editionData zebedee.Dataset) (*datasetModels.Version, error)

MapDatasetVersionToDatasetAPI maps a Zebedee dataset version to a Dataset API dataset model.

func MapMimeTypeToDistributionFormat added in v0.26.1

func MapMimeTypeToDistributionFormat(mimeType string) (datasetModels.DistributionFormat, error)

MapMimeTypeToDistributionFormat maps a MIME type string to a DistributionFormat as used by the dp-dataset-api. If the MIME type is unsupported, it returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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