configfile

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package configfile implements a config file loader and saver

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install()

Install installs the config file handler

Types

type Storage

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

Storage implements config.Storage for saving and loading config data in a simple INI based file.

func (*Storage) DeleteKey

func (s *Storage) DeleteKey(section string, key string) bool

DeleteKey removes the key under section

func (*Storage) DeleteSection

func (s *Storage) DeleteSection(section string)

DeleteSection removes the named section and all config from the config file

func (*Storage) GetKeyList

func (s *Storage) GetKeyList(section string) []string

GetKeyList returns the keys in this section

func (*Storage) GetSectionList

func (s *Storage) GetSectionList() []string

GetSectionList returns a slice of strings with names for all the sections

func (*Storage) GetValue

func (s *Storage) GetValue(section string, key string) (value string, found bool)

GetValue returns the key in section with a found flag

func (*Storage) HasSection

func (s *Storage) HasSection(section string) bool

HasSection returns true if section exists in the config file

func (*Storage) Load

func (s *Storage) Load() (err error)

Load the config from permanent storage, decrypting if necessary

func (*Storage) Save

func (s *Storage) Save() error

Save the config to permanent storage, encrypting if necessary

func (*Storage) Serialize

func (s *Storage) Serialize() (string, error)

Serialize the config into a string

func (*Storage) SetValue

func (s *Storage) SetValue(section string, key string, value string)

SetValue sets the value under key in section

Jump to

Keyboard shortcuts

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