Documentation
¶
Overview ¶
Package config provides configuration file management.
Index ¶
- func DefaultConfigDir() string
- func DefaultConfigPath() string
- func FormatMissingEnvVars(missing []string, vars []RequiredEnvVar) string
- func ValidateAPICredentials() error
- func ValidateRequiredEnvVars(vars []RequiredEnvVar) []string
- type FileStore
- type MockConfigStore
- func (m *MockConfigStore) Exists() bool
- func (m *MockConfigStore) Load() (*domain.Config, error)
- func (m *MockConfigStore) Path() string
- func (m *MockConfigStore) Save(config *domain.Config) error
- func (m *MockConfigStore) SetConfig(config *domain.Config)
- func (m *MockConfigStore) SetExists(exists bool)
- type RequiredEnvVar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigDir ¶
func DefaultConfigDir() string
DefaultConfigDir returns the default config directory.
func DefaultConfigPath ¶
func DefaultConfigPath() string
DefaultConfigPath returns the default config file path.
func FormatMissingEnvVars ¶
func FormatMissingEnvVars(missing []string, vars []RequiredEnvVar) string
FormatMissingEnvVars formats missing environment variables into a user-friendly error message.
func ValidateAPICredentials ¶
func ValidateAPICredentials() error
ValidateAPICredentials validates Nylas API credentials from environment.
func ValidateRequiredEnvVars ¶
func ValidateRequiredEnvVars(vars []RequiredEnvVar) []string
ValidateRequiredEnvVars validates that all required environment variables are set. Returns a slice of missing variables.
Types ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore implements ConfigStore using a YAML file.
func NewDefaultFileStore ¶
func NewDefaultFileStore() *FileStore
NewDefaultFileStore creates a FileStore at the default location.
type MockConfigStore ¶
type MockConfigStore struct {
// contains filtered or unexported fields
}
MockConfigStore is a mock implementation of ConfigStore for testing.
func NewMockConfigStore ¶
func NewMockConfigStore() *MockConfigStore
NewMockConfigStore creates a new MockConfigStore.
func (*MockConfigStore) Exists ¶
func (m *MockConfigStore) Exists() bool
Exists returns whether the config exists.
func (*MockConfigStore) Load ¶
func (m *MockConfigStore) Load() (*domain.Config, error)
Load loads the configuration.
func (*MockConfigStore) Save ¶
func (m *MockConfigStore) Save(config *domain.Config) error
Save saves the configuration.
func (*MockConfigStore) SetConfig ¶
func (m *MockConfigStore) SetConfig(config *domain.Config)
SetConfig sets the mock config.
func (*MockConfigStore) SetExists ¶
func (m *MockConfigStore) SetExists(exists bool)
SetExists sets whether the config file exists.
type RequiredEnvVar ¶
RequiredEnvVar represents a required environment variable.