extensions

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UnsupportedExt is used for unsupported file extension
	UnsupportedExt = Ext{Supported: false, FileType: FileTypeUnsupported}
)

Functions

This section is empty.

Types

type Ext added in v0.7.0

type Ext struct {
	Ext         string      `json:"ext"`
	FileType    FileType    `json:"fileType"`
	Supported   bool        `json:"supported"`
	PreviewType PreviewType `json:"previewType"`
}

Ext is a struct which contains type of the original file and type for preview

func GetExt

func GetExt(ext string) Ext

GetExt returns Ext according to passed file ext. If there's no such extension, it returns UnsupportedExt

type FileType added in v0.7.0

type FileType string
const (
	FileTypeUnsupported FileType = "unsupported"

	FileTypeArchive  FileType = "archive"
	FileTypeAudio    FileType = "audio"
	FileTypeImage    FileType = "image"
	FileTypeLanguage FileType = "lang"
	FileTypeText     FileType = "text"
	FileTypeVideo    FileType = "video"
)

File types

type PreviewType added in v0.7.0

type PreviewType string
const (
	PreviewTypeUnsupported PreviewType = ""

	// audio
	PreviewTypeAudioMP3 PreviewType = "audio/mpeg"
	PreviewTypeAudioOGG PreviewType = "audio/ogg"
	PreviewTypeAudioWAV PreviewType = "audio/wav"
	// image
	PreviewTypeImage PreviewType = "image"
	// video
	PreviewTypeVideoMP4  PreviewType = "video/mp4"
	PreviewTypeVideoWebM PreviewType = "video/webm"
	// text
	PreviewTypeText PreviewType = "text"
)

Preview types

Jump to

Keyboard shortcuts

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