config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package config provides configuration utilities for plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(config Config, key string) (bool, bool)

GetBool extracts a bool from config, returning (value, found).

func GetBoolDefault

func GetBoolDefault(config Config, key string, defaultValue bool) bool

GetBoolDefault extracts a bool from config or returns the default value.

func GetFloat

func GetFloat(config Config, key string) (float64, bool)

GetFloat extracts a float64 from config, handling float64, int, and int64.

func GetFloatDefault

func GetFloatDefault(config Config, key string, defaultValue float64) float64

GetFloatDefault extracts a float64 from config or returns the default value.

func GetInt

func GetInt(config Config, key string) (int, bool)

GetInt extracts an int from config, handling int, int64, and float64.

func GetIntDefault

func GetIntDefault(config Config, key string, defaultValue int) int

GetIntDefault extracts an int from config or returns the default value.

func GetString

func GetString(config Config, key string) (string, bool)

GetString extracts a string from config, returning (value, found).

func GetStringDefault

func GetStringDefault(config Config, key, defaultValue string) string

GetStringDefault extracts a string from config or returns the default value.

func GetStringSlice

func GetStringSlice(config Config, key string) ([]string, bool)

GetStringSlice extracts a []string from config, returning (value, found).

func MustGetBool

func MustGetBool(config Config, key string) (bool, error)

MustGetBool extracts a required bool from config or returns error.

func MustGetFloat

func MustGetFloat(config Config, key string) (float64, error)

MustGetFloat extracts a required float64 from config or returns error.

func MustGetInt

func MustGetInt(config Config, key string) (int, error)

MustGetInt extracts a required int from config or returns error.

func MustGetString

func MustGetString(config Config, key string) (string, error)

MustGetString extracts a required string from config or returns error.

Types

type Config

type Config = map[string]any

Config represents plugin configuration as a key-value map.

Jump to

Keyboard shortcuts

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