importer

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 6 Imported by: 1

README

go-jsonnet-alias-importer

alias importer for go-jsonenet

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAliasPath = errors.New("invalid alias path")
	ErrAliasNotFound    = errors.New("alias not found")
)

Functions

This section is empty.

Types

type AliasImpoter

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

func New

func New(opts ...Option) *AliasImpoter

func (*AliasImpoter) ClearCache

func (im *AliasImpoter) ClearCache()

func (*AliasImpoter) Import

func (im *AliasImpoter) Import(importedFrom, importedPath string) (contents jsonnet.Contents, foundAt string, err error)

func (*AliasImpoter) Register

func (im *AliasImpoter) Register(alias string, fs fs.FS)

type Option

type Option func(*AliasImpoter)

func WithParent

func WithParent(parent jsonnet.Importer) Option

WithParent sets the parent importer. default is *jsonnet.FileImporter

func WithSigil

func WithSigil(sigil rune) Option

WithSigil sets the sigil for alias path prefix. default is '@'

Jump to

Keyboard shortcuts

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