resource

package
v0.3.0 Latest Latest
Warning

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

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

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