config

package module
v0.0.0-...-e11f9f9 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 7 Imported by: 1

README

config

This is a support library for groom.

It checks and parses the configuration and provides methods for modifying it.

It is most useful for developing subcommands for groom(https://github.com/golang-groom/groom)

Usage

The library only exposes a few functions ParseConf and AddSubcommand..

Documentation

Overview

Package parses the config (global and user) and provides to the application. It is a support library for the `groom` suite of application.

Index

Constants

This section is empty.

Variables

View Source
var GROOM_CONFIG_LOCATIONS []configLocation = []configLocation{
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
}

Global variable defines the location of the config file to be present. The order of the array determines the order of the config location checking.

Locations for parsing (In order of preference) - /etc/groom/config.toml - $XDG_CONFIG_HOME/.config/config.toml - $HOME/.config/config.toml

Functions

func AddSubcommand

func AddSubcommand(name string, description string, binary string)

func SyncConfig

func SyncConfig()

Types

type GroomConfig

type GroomConfig struct {
	GroomBin   string `toml:"groomBin"`
	ConfigPath string

	Plugins []Plugin `toml:"plugin"`
}

func ParseConf

func ParseConf() *GroomConfig

Function parses the configuration file. If no config found at default locations, return good-enough values.

type Plugin

type Plugin struct {
	Name        string `toml:"name"`
	Description string `toml:"description"`
	Binary      string `toml:"binary"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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