Documentation ¶
Index ¶
- Variables
- func BuildTemplate(fs fs.FS, filename string) (*template.Template, error)
- func HasDNSLinkOrigin(gwURL string, path string) bool
- func ShortHash(hash string) string
- type Breadcrumb
- type DagTemplateData
- type DirectoryItem
- type DirectoryTemplateData
- type ErrorTemplateData
- type GlobalData
- type MenuItem
- type ParsedNode
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DirectoryTemplate *template.Template DagTemplate *template.Template ErrorTemplate *template.Template )
View Source
var AssetHash string
AssetHash a non-cryptographic hash of all embedded assets
View Source
var KnownIcons = map[string]bool{ ".aac": true, ".ai": true, ".aiff": true, ".avi": true, ".bmp": true, ".c": true, ".cpp": true, ".css": true, ".dat": true, ".dmg": true, ".doc": true, ".docx": true, ".dotx": true, ".dwg": true, ".dxf": true, ".eps": true, ".exe": true, ".flv": true, ".gif": true, ".h": true, ".hpp": true, ".html": true, ".ics": true, ".iso": true, ".java": true, ".jpg": true, ".jpeg": true, ".js": true, ".key": true, ".less": true, ".mid": true, ".mkv": true, ".mov": true, ".mp3": true, ".mp4": true, ".mpg": true, ".odf": true, ".ods": true, ".odt": true, ".ott": true, ".pdf": true, ".php": true, ".png": true, ".ppt": true, ".psd": true, ".py": true, ".qt": true, ".rar": true, ".rb": true, ".rtf": true, ".sass": true, ".scss": true, ".sql": true, ".tga": true, ".tgz": true, ".tiff": true, ".txt": true, ".wav": true, ".wmv": true, ".xls": true, ".xlsx": true, ".xml": true, ".yml": true, ".zip": true, }
Functions ¶
func BuildTemplate ¶ added in v0.9.0
func HasDNSLinkOrigin ¶
helper to detect DNSLink website context (when hostname from gwURL is matching /ipns/<fqdn> in path)
Types ¶
type Breadcrumb ¶
func Breadcrumbs ¶
func Breadcrumbs(urlPath string, dnslinkOrigin bool) []Breadcrumb
type DagTemplateData ¶
type DagTemplateData struct { GlobalData Path string CID string CodecName string CodecHex string Node *ParsedNode }
type DirectoryItem ¶
type DirectoryTemplateData ¶
type DirectoryTemplateData struct { GlobalData Listing []DirectoryItem Size string Path string Breadcrumbs []Breadcrumb BackLink string Hash string }
type ErrorTemplateData ¶ added in v0.9.0
type ErrorTemplateData struct { GlobalData StatusCode int StatusText string Error string }
type GlobalData ¶ added in v0.9.0
type ParsedNode ¶ added in v0.9.0
type ParsedNode struct { Keys []*ParsedNode Values []*ParsedNode Value string CID string Long bool }
Click to show internal directories.
Click to hide internal directories.