types

package
Version: v0.0.0-...-725082c Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeByExtension

func TypeByExtension(path string) string

TypeByExtension returns the type of a file according to its extension. A complete path can be provided, or just the extension with or without dot.

Types

type FileEntry

type FileEntry struct {
	Name        string
	Size        int64
	Content     []byte
	Template    *ogdl.Graph
	Data        *ogdl.Graph
	Info        *ogdl.Graph
	Type        string
	IsDirectory bool // This is for the original path, not the index.*
	Mime        string
	Time        time.Time
	Param       map[string]string
	Mode        os.FileMode
	Dir         []os.FileInfo
	Doc         *document.Document
}

FileEntry type TODO: interface extension of os.FileInfo?

type FileInfo interface {
    Name() string       // base name of the file
    Size() int64        // length in bytes for regular files; system-dependent for others
    Mode() FileMode     // file mode bits
    ModTime() time.Time // modification time
    IsDir() bool        // abbreviation for Mode().IsDir()
    Sys() interface{}   // underlying data source (can return nil)
}

func (*FileEntry) IsDir

func (f *FileEntry) IsDir() bool

TODO use mode bit

func (*FileEntry) Prepare

func (f *FileEntry) Prepare()

Prepare preprocesses some types of files: markdown, templates.

Source Files

Jump to

Keyboard shortcuts

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