apifiles

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package apifiles snapshots API files for content-addressed delivery.

Index

Constants

View Source
const (
	// MaxBytes caps a complete API bundle, outside the manifest's KV limit.
	MaxBytes = 32 << 20
	// MaxFiles bounds the number of documents in a bundle.
	MaxFiles = 256
)

Variables

View Source
var ErrBundle = errors.New("route: invalid API file bundle")

ErrBundle is an invalid or oversized API file bundle.

Functions

This section is empty.

Types

type Files

type Files struct {
	// contains filtered or unexported fields
}

Files is an immutable snapshot. Open never returns a directory listing.

func Snapshot

func Snapshot(source fs.FS, entry string) (*Files, error)

Snapshot reads only regular files, bounds total size and validates the entry.

func (*Files) Hash

func (f *Files) Hash() string

Hash addresses every file in this snapshot.

func (*Files) Open

func (f *Files) Open(name string) (fs.File, error)

Open implements fs.FS with seekable files for http.FileServerFS.

Jump to

Keyboard shortcuts

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