providers

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package providers implements a base FS-based configuration provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSProvider

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

FSProvider provides file system operations by wrapping an fs.FS implementation. It is used as a base provider for other file-based configuration providers.

func NewFSProvider

func NewFSProvider(fileFS fs.FS) *FSProvider

NewFSProvider creates a new FSProvider with the given fs.FS implementation. If fileFS is nil, it defaults to using sysfs.NewSysFS().

func (*FSProvider) OpenFile

func (p *FSProvider) OpenFile(name string) (fs.File, error)

OpenFile opens the named file using the underlying fs.FS implementation.

func (*FSProvider) ReadFile

func (p *FSProvider) ReadFile(name string) ([]byte, error)

ReadFile reads the named file using the underlying fs.FS implementation.

func (*FSProvider) SetFS

func (p *FSProvider) SetFS(fileFS fs.FS)

SetFS sets the underlying fs.FS implementation.

Jump to

Keyboard shortcuts

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