file

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package file provides file protocol for NVGD.

Index

Constants

View Source
const (
	KeepCompress = "keepcompress"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
}

File is file protocol handler.

func (*File) Open

func (f *File) Open(u *url.URL) (*resource.Resource, error)

Open opens a URL as file.

func (*File) OpenRange added in v1.15.0

func (f *File) OpenRange(u *url.URL, start, end int) (*resource.Resource, error)

func (*File) Size added in v1.15.0

func (f *File) Size(u *url.URL) (int, error)

type FileConfig

type FileConfig struct {
	// Locations is allowed paths to access.
	Locations []string `yaml:"locations"`

	// Forbiddens is fobidden paths to access. It overrides Locations.
	Forbiddens []string `yaml:"forbiddens"`

	// UseUnixtime makes times in UNIX format: modified_at or so.
	UseUnixtime bool `yaml:"use_unixtime"`
}

FileConfig provides configuration for file protocol.

Jump to

Keyboard shortcuts

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