config.go
config.go - Overview
-
Overview This file defines the configuration structure for the version package, including banner configurations and a factory for creating default configurations. It also includes validation logic for the configuration.
-
Detailed Documentation
type BannerConfig
-
Purpose: Defines the configuration for the banner display.
- Fields:
Enabled
(bool): Indicates whether the banner is enabled.
- Fields:
type Config
-
Purpose: Defines the overall configuration structure for the version package.
- Fields:
Banner
(BannerConfig): Configuration settings for the banner.
- Fields:
func NewConfigFactory() factory.ConfigFactory
- Purpose: Creates a new ConfigFactory for the version package.
- Returns:
factory.ConfigFactory
: A new configuration factory instance.
func newConfig() factory.Config
- Purpose: Creates a new default configuration for the version package.
- Returns:
Config
: A newConfig
instance with default values. The default banner is enabled.
func (c Config) Validate() error
- Purpose: Validates the configuration.
- Parameters:
c
(Config): The configuration to validate.
- Returns:
error
: Returnsnil
as validation always passes in the current implementation.
Include in Getting Started: NO