importer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Importer

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

Importer is an Importer that can read Risor code modules from a filesystem implementing the `fs.FS` interface.

func NewImporter

func NewImporter(opts ImporterOptions) *Importer

NewImporter returns an Importer that can read Risor code modules from a filesystem implementing the `fs.FS` interface.

func (*Importer) Import

func (i *Importer) Import(_ context.Context, name string) (*object.Module, error)

Import a module by name.

type ImporterOptions

type ImporterOptions struct {
	// Global names that should be available when the module is compiled.
	GlobalNames []string

	// The filesystem to search for Risor modules.
	SourceFS fs.FS
}

ImporterOptions configure an Importer that can read from a filesystem implementing the `fs.FS` interface.

Jump to

Keyboard shortcuts

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