Documentation
¶
Index ¶
- Constants
- func ApplyProjectConfigDefaults(mod config.Module)
- func IsNil(v any) bool
- func PrepareParams(m config.Params)
- func ToParamsAndPrepare(in any) (config.Params, bool)
- func ToStringE(i interface{}) (string, error)
- func ToStringMapE(in any) (map[string]any, error)
- type CompositeConfig
- type DefaultConfigProvider
- type ModuleCollector
Constants ¶
const ( ComponentFolderArchetypes = "archetypes" ComponentFolderStatic = "static" ComponentFolderLayouts = "layouts" ComponentFolderContent = "content" ComponentFolderData = "data" ComponentFolderAssets = "assets" ComponentFolderI18n = "i18n" )
Module folder structure
Variables ¶
This section is empty.
Functions ¶
func ApplyProjectConfigDefaults ¶
ApplyProjectConfigDefaults applies default/missing module configuration for the main project.
func PrepareParams ¶
PrepareParams * makes all the keys lower cased * This will modify the map given. * Any nested map[string]interface{}, map[string]string * will be converted to Params.
func ToParamsAndPrepare ¶
ToParamsAndPrepare converts in to Params and prepares it for use. If in is nil, an empty map is returned. See PrepareParams.
Types ¶
type CompositeConfig ¶
CompositeConfig contains a read only config Base with a possibly writeable config Layer on top.
func (*CompositeConfig) Get ¶
func (c *CompositeConfig) Get(key string) any
func (*CompositeConfig) GetString ¶
func (c *CompositeConfig) GetString(key string) string
func (*CompositeConfig) IsSet ¶
func (c *CompositeConfig) IsSet(key string) bool
func (*CompositeConfig) Set ¶
func (c *CompositeConfig) Set(key string, value any)
func (*CompositeConfig) SetDefaults ¶
func (c *CompositeConfig) SetDefaults(params config.Params)
type DefaultConfigProvider ¶
DefaultConfigProvider Provider接口实现对象
func (*DefaultConfigProvider) Get ¶
func (c *DefaultConfigProvider) Get(k string) any
Get 按key获取值 约定""键对应的是c.Root 嵌套获取值
func (*DefaultConfigProvider) GetString ¶
func (c *DefaultConfigProvider) GetString(k string) string
func (*DefaultConfigProvider) IsSet ¶
func (c *DefaultConfigProvider) IsSet(k string) bool
func (*DefaultConfigProvider) Set ¶
func (c *DefaultConfigProvider) Set(k string, v any)
Set 设置键值对 统一key的格式为小写字母 如果传入的值符合Params的要求,通过root进行设置 如果为非Params类型,则直接赋值
func (*DefaultConfigProvider) SetDefaults ¶
func (c *DefaultConfigProvider) SetDefaults(params config.Params)
SetDefaults will set values from params if not already set.
type ModuleCollector ¶
func NewModuleCollector ¶
func NewModuleCollector() *ModuleCollector
func (*ModuleCollector) CollectModules ¶
func (mc *ModuleCollector) CollectModules(modConfig config.ModuleConfig, hookBeforeFinalize func(m config.Modules))