config

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service provides app-scoped configuration management It wraps Forge's ConfigManager to provide multi-tenant configuration support.

func NewService

func NewService(forgeConfig forge.ConfigManager) *Service

NewService creates a new configuration service.

func (*Service) Bind

func (s *Service) Bind(appID, key string, target any) error

Bind binds configuration for a specific app If appID is empty, uses global configuration from Forge ConfigManager If appID is provided, merges app-specific overrides with global config.

func (*Service) Get

func (s *Service) Get(appID, key string) any

Get gets a configuration value for a specific app.

func (*Service) GetAppConfig

func (s *Service) GetAppConfig(appID string) map[string]any

GetAppConfig gets all configuration for a specific app.

func (*Service) GetBool

func (s *Service) GetBool(appID, key string) bool

GetBool gets a boolean configuration value.

func (*Service) GetInt

func (s *Service) GetInt(appID, key string) int

GetInt gets an integer configuration value.

func (*Service) GetString

func (s *Service) GetString(appID, key string) string

GetString gets a string configuration value.

func (*Service) IsSet

func (s *Service) IsSet(appID, key string) bool

IsSet checks if a configuration key is set for a specific app.

func (*Service) LoadAppConfig

func (s *Service) LoadAppConfig(appID string, config map[string]any) error

LoadAppConfig loads configuration for a specific app.

func (*Service) MergeConfig

func (s *Service) MergeConfig(appID string, target any) error

MergeConfig merges app-specific config with global config This is similar to Bind but unmarshals the entire config instead of a specific key.

func (*Service) RemoveAppConfig

func (s *Service) RemoveAppConfig(appID string)

RemoveAppConfig removes all configuration for a specific app.

func (*Service) Set

func (s *Service) Set(appID, key string, value any) error

Set sets a configuration value for a specific app.

Jump to

Keyboard shortcuts

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