configfile

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package configfile contains primitives needed to manage a configuration file with the syntax of PostgreSQL

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConnectionString

func CreateConnectionString(parameters map[string]string) string

CreateConnectionString create a PostgreSQL connection string given the passed parameters, escaping them as necessary

func EnsureIncludes added in v1.19.6

func EnsureIncludes(fileName string, filesToInclude ...string) (changed bool, err error)

EnsureIncludes makes sure the passed PostgreSQL configuration file has an include directive to every filesToInclude.

func ReadLinesFromConfigurationContents added in v1.19.6

func ReadLinesFromConfigurationContents(content []string, options ...string) []string

ReadLinesFromConfigurationContents read the options from the configuration file as a map

func RemoveOptionsFromConfigurationContents added in v1.19.6

func RemoveOptionsFromConfigurationContents(lines []string, options ...string) []string

RemoveOptionsFromConfigurationContents deletes all the lines containing one of the given options from the provided configuration content

func UpdateConfigurationContents

func UpdateConfigurationContents(lines []string, options map[string]string) ([]string, error)

UpdateConfigurationContents search and replace options in a configuration file whose content is passed

func UpdatePostgresConfigurationFile

func UpdatePostgresConfigurationFile(
	fileName string,
	options map[string]string,
	managedOptions ...string,
) (changed bool, err error)

UpdatePostgresConfigurationFile search and replace options in a Postgres configuration file. If any managedOptions is passed, it will be removed unless present in the options map. If the configuration file doesn't exist, it will be written.

func WritePostgresConfigurationFile added in v1.20.6

func WritePostgresConfigurationFile(
	fileName string,
	options map[string]string,
) (changed bool, err error)

WritePostgresConfigurationFile replaces the content of a Postgres configuration file with the provide options

Types

This section is empty.

Jump to

Keyboard shortcuts

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