config

package
v0.0.0-...-5bc8923 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Values

type Values struct {
	Credentials *device.Credentials `json:"credentials,omitempty"`
}

Values from an IoTap configuration.

func LoadFromConfigDir

func LoadFromConfigDir() (*Values, error)

LoadFromConfigDir creates a new *Values instance from a user config directory file. It returns an error if the file cannot be opened or contains invalid data.

func LoadFromEnv

func LoadFromEnv() (*Values, error)

LoadFromEnv initializes a new *Values instance using values from the environment. It returns an error if the required environment variables are missing or invalid.

func LoadValues

func LoadValues() (*Values, error)

LoadValues creates a new *Values instance from two sources, with order of precedence: 1. Environment variables (IOTAP_*) 2. Configuration file at default location (~/.config/iotap.json)

func NewValues

func NewValues(r io.Reader) (*Values, error)

NewValues creates a new *Values instance by parsing data from the provided reader. It returns an error if the data is invalid or cannot be parsed.