zip

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZipLoader

type ZipLoader struct {
	Local string
	// contains filtered or unexported fields
}

ZipLoader allows serving website content from a local zip file. Local should be set as the local filename.

func (*ZipLoader) Count

func (zl *ZipLoader) Count() int

func (*ZipLoader) Exists

func (zl *ZipLoader) Exists(path string) bool

func (*ZipLoader) Fetch added in v0.1.2

func (zl *ZipLoader) Fetch(ctx context.Context, url string) error

Fetch fetches the zip at the given URL and swaps it in-place, replacing the current file.

func (*ZipLoader) Get

func (zl *ZipLoader) Get(path string) (*static.FileInfo, io.ReadCloser)

func (*ZipLoader) Load

func (zl *ZipLoader) Load() (exists bool, err error)

Load sets up content from the local zip file.

func (*ZipLoader) ServeHTTP added in v0.1.2

func (zl *ZipLoader) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP allows uploading a zip file directly. This just accepts the file blindly.

func (*ZipLoader) Update

func (zl *ZipLoader) Update(r io.Reader, mtime time.Time) error

Update puts a zip from the given reader over the prior cached content.

func (*ZipLoader) When

func (zl *ZipLoader) When() time.Time

When indicates when the zip file was loaded from cache.

Jump to

Keyboard shortcuts

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