config

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: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompositeConfig

type CompositeConfig interface {
	Base() Provider
	Layer() Provider
}

type Import

type Import struct {
	// Module pathspec
	Path string
}

type Module

type Module interface {
	// Config The decoded module config and mounts.
	Config() ModuleConfig
	// Owner In the dependency tree, this is the first module that defines this module
	// as a dependency.
	Owner() Module
	// Mounts Any directory remappings.
	Mounts() []Mount
}

type ModuleConfig

type ModuleConfig struct {
	Mounts  []Mount
	Imports []Import
}

ModuleConfig holds a module config.

type Modules

type Modules []Module

type Mount

type Mount struct {
	// relative pathspec in source repo, e.g. "scss"
	Source string
	// relative target pathspec, e.g. "assets/bootstrap/scss"
	Target string
	// any language code associated with this mount.
	Lang string
}

type Params

type Params map[string]any

Params 参数格式定义 关键字为字符类型 值为通用类型any

func (Params) Set

func (p Params) Set(pp Params)

Set 根据新传入参数,对应层级进行重写 pp为新传入参数 p为当前参数 将pp的值按层级结构写入p 递归完成

type Provider

type Provider interface {
	Get(key string) any
	Set(key string, value any)
	SetDefaults(params Params)
	GetString(key string) string
	IsSet(key string) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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