resource

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 5 modules, 22 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package resource owns named package filesystems shared by compilation and invocation. Registering a named filesystem never creates an implicit default.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func New

func New() *Store

func (*Store) Filesystem added in v0.3.0

func (s *Store) Filesystem(name string) (fs.FS, bool)

Filesystem returns the registered filesystem for a namespace.

func (*Store) Lookup

func (s *Store) Lookup(name string) (fs.FS, bool)

func (*Store) Open

func (s *Store) Open(reference string) (fs.File, error)

func (*Store) ReadFile

func (s *Store) ReadFile(reference string) ([]byte, error)

func (*Store) Register

func (s *Store) Register(name string, source fs.FS) error

func (*Store) WithDefault

func (s *Store) WithDefault(source fs.FS) (*Store, error)

WithDefault returns a source-local default view over the same named authority. Named Register/Lookup remain shared; registering a default on this view fails because its default was fixed at construction. The supplied FS must be immutable.

Jump to

Keyboard shortcuts

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