conttype

package
v1.2.27 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ContentTypeUndefinedMsg - message raised when content type for specific extension is not defined
	ContentTypeUndefinedMsg = `content type for the "%s" extension is not defined`
)

Variables

View Source
var ContentTypeConfig = []byte{} /* 1050 elements not displayed */

ContentTypeConfig - do not edit

Functions

func GetContentType

func GetContentType(cfg *ContentTypes, extension string) (string, error)

GetContentType - get content type by file extension

Types

type ContentType

type ContentType struct {
	Extension   string `yaml:"extension"`
	ContentType string `yaml:"content-type"`
}

ContentType - content types

type ContentTypes

type ContentTypes struct {
	ContentTypes []ContentType `yaml:"content-types"`
}

ContentTypes - data structure for content types configuration

func GetContentTypes

func GetContentTypes() (*ContentTypes, error)

GetContentTypes - gets content types associated with files extensions from the configuration config_type_cgf.yaml

Jump to

Keyboard shortcuts

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