fileconfig

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package fileconfig provides HCL file config loading and watching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string) (*config.Config, error)

func WatchPath

func WatchPath(path string, onChange func(), onError func(error)) (io.Closer, error)

func WatchPathWithLogger

func WatchPathWithLogger(path string, logger *slog.Logger, onChange func(), onError func(error)) (io.Closer, error)

func WithConfigFileList

func WithConfigFileList(paths *collectionlist.List[string]) gateway.Option

func WithConfigFiles

func WithConfigFiles(paths ...string) gateway.Option

func WithConfigPath

func WithConfigPath(path string) gateway.Option

Types

type Provider

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

func New

func New(path string) *Provider

func NewWithLogger

func NewWithLogger(path string, logger *slog.Logger) *Provider

func (*Provider) Load

func (p *Provider) Load(_ context.Context) (*config.Config, error)

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) SetLogger

func (p *Provider) SetLogger(logger *slog.Logger)

func (*Provider) Watch

func (p *Provider) Watch(_ context.Context, onReload func(), onError func(error)) (io.Closer, error)

Jump to

Keyboard shortcuts

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