detect

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsImage

func IsImage(path string) bool

func IsNative

func IsNative(kind Kind) bool

func IsOffice

func IsOffice(kind Kind) bool

func IsPresentation

func IsPresentation(kind Kind) bool

func IsSupportedFile

func IsSupportedFile(path string) bool

Types

type Input

type Input struct {
	Path      string   `json:"path"`
	SourceURL string   `json:"source_url,omitempty"`
	Name      string   `json:"name"`
	Kind      Kind     `json:"kind"`
	Files     []string `json:"files,omitempty"`
	SHA256    string   `json:"sha256"`
}

func Detect

func Detect(path string) (Input, error)

type Kind

type Kind string
const (
	KindPDF        Kind = "pdf"
	KindDOC        Kind = "doc"
	KindDOCX       Kind = "docx"
	KindODT        Kind = "odt"
	KindRTF        Kind = "rtf"
	KindPPT        Kind = "ppt"
	KindPPTX       Kind = "pptx"
	KindODP        Kind = "odp"
	KindXLS        Kind = "xls"
	KindXLSX       Kind = "xlsx"
	KindODS        Kind = "ods"
	KindHTML       Kind = "html"
	KindSVG        Kind = "svg"
	KindMarkdown   Kind = "markdown"
	KindText       Kind = "text"
	KindCSV        Kind = "csv"
	KindTSV        Kind = "tsv"
	KindJSON       Kind = "json"
	KindXML        Kind = "xml"
	KindYAML       Kind = "yaml"
	KindEPUB       Kind = "epub"
	KindEML        Kind = "eml"
	KindMHTML      Kind = "mhtml"
	KindMSG        Kind = "msg"
	KindIPYNB      Kind = "ipynb"
	KindImage      Kind = "image"
	KindImageDir   Kind = "image_dir"
	KindHTMLSlides Kind = "html_slides"
)

func KindForExtension

func KindForExtension(extension string) (Kind, bool)

Jump to

Keyboard shortcuts

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