valueobject

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

func ApplyProjectConfigDefaults(mod config.Module)

ApplyProjectConfigDefaults applies default/missing module configuration for the main project.

func IsNil

func IsNil(v any) bool

IsNil reports whether v is nil.

func PrepareParams

func PrepareParams(m config.Params)

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

func ToParamsAndPrepare(in any) (config.Params, bool)

ToParamsAndPrepare converts in to Params and prepares it for use. If in is nil, an empty map is returned. See PrepareParams.

func ToStringE

func ToStringE(i interface{}) (string, error)

ToStringE casts an interface to a string type.

func ToStringMapE

func ToStringMapE(in any) (map[string]any, error)

ToStringMapE converts in to map[string]interface{}.

Types

type CompositeConfig

type CompositeConfig struct {
	Base  config.Provider
	Layer config.Provider
}

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

type DefaultConfigProvider struct {
	Root config.Params
}

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

type ModuleCollector struct {
	Modules config.Modules
}

func NewModuleCollector

func NewModuleCollector() *ModuleCollector

func (*ModuleCollector) CollectModules

func (mc *ModuleCollector) CollectModules(modConfig config.ModuleConfig, hookBeforeFinalize func(m config.Modules))

Jump to

Keyboard shortcuts

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