file

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path string
}

Config represents the configuration for file reader Path is the base path for the file reader

type FileConfigReader

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

func NewFileConfigReader

func NewFileConfigReader(config *Config) *FileConfigReader

func (*FileConfigReader) Read

func (a *FileConfigReader) Read(ctx context.Context, path string, conf any, configFormat ...common.ConfigFormatType) error

Read reads the configuration from the file path : path in file to read the configuration from conf : configuration object to unmarshal the data into configFormat : format of the configuration data returns error if any returns nil if successful

func (*FileConfigReader) Update

func (a *FileConfigReader) Update(ctx context.Context, path string, conf any, configFormat ...common.ConfigFormatType) error

Update updates the configuration in the file path : path in file to update the configuration conf : configuration object to marshal the data from configFormat : format of the configuration data returns error if any returns nil if successful

Jump to

Keyboard shortcuts

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