config

package
v0.1.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Copyright (c) 2025 Nexlayer. All rights reserved.n// Use of this source code is governed by an MIT-stylen// license that can be found in the LICENSE file.nn

Copyright (c) 2025 Nexlayer. All rights reserved.n// Use of this source code is governed by an MIT-stylen// license that can be found in the LICENSE file.nn

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigDir

func GetConfigDir() string

GetConfigDir returns the configuration directory

Types

type Config

type Config struct {
	APIEndpoints map[string]string
	PluginsDir   string
}

Config represents the application configuration

func GetConfig

func GetConfig() *Config

GetConfig returns the application configuration

func (*Config) GetAPIEndpoint

func (c *Config) GetAPIEndpoint(env string) string

GetAPIEndpoint returns the API endpoint for the given environment

func (*Config) GetPluginsDir

func (c *Config) GetPluginsDir() string

GetPluginsDir returns the plugins directory

type Manager

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

Manager handles configuration management

func NewManager

func NewManager() *Manager

NewManager creates a new configuration manager

func (*Manager) GetAPIEndpoint

func (m *Manager) GetAPIEndpoint(env string) string

GetAPIEndpoint returns the API endpoint for the given environment

func (*Manager) GetDefaultNamespace

func (m *Manager) GetDefaultNamespace() string

GetDefaultNamespace returns the default namespace

func (*Manager) GetString

func (m *Manager) GetString(key string) string

GetString gets a string value from configuration

func (*Manager) GetStringMap

func (m *Manager) GetStringMap(key string) map[string]string

GetStringMap gets a string map from configuration

func (*Manager) Save

func (m *Manager) Save() error

Save saves the configuration to disk

func (*Manager) Set

func (m *Manager) Set(key string, value interface{})

Set sets a configuration value

func (*Manager) SetDefaultNamespace

func (m *Manager) SetDefaultNamespace(namespace string) error

SetDefaultNamespace sets the default namespace

Jump to

Keyboard shortcuts

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