config

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const NamespaceImportSuffix = ".*"

NamespaceImportSuffix is the suffix used to identify namespace import keys.

View Source
const RootConfigFileName = ".ingitdb.yaml"
View Source
const SubscribersConfigFileName = ".ingitdb/subscribers.yaml"

Variables

This section is empty.

Functions

func IsNamespaceImport added in v0.25.0

func IsNamespaceImport(key string) bool

IsNamespaceImport returns true if the key ends with ".*" suffix, indicating it is a namespace import that references another directory's .ingitdb.yaml file.

Types

type Language

type Language struct {
	Required string `yaml:"required,omitempty"`
	Optional string `yaml:"optional,omitempty"`
}

type RootConfig

type RootConfig struct {
	// DefaultNamespace is used as the collection ID prefix when this DB is
	// opened directly (not imported via a namespace import). For example,
	// if DefaultNamespace is "todo" and the DB has collection "tasks",
	// it becomes "todo.tasks" when opened directly.
	DefaultNamespace string            `yaml:"default_namespace,omitempty"`
	RootCollections  map[string]string `yaml:"rootCollections,omitempty"`
	Languages        []Language        `yaml:"languages,omitempty"`
}

func ReadRootConfigFromFile

func ReadRootConfigFromFile(dirPath string, o ingitdb.ReadOptions) (rootConfig RootConfig, err error)

func (*RootConfig) ResolveNamespaceImports added in v0.25.0

func (rc *RootConfig) ResolveNamespaceImports(baseDirPath string) error

ResolveNamespaceImports resolves all namespace import keys (ending with ".*") in rootCollections. For each such key, it reads the .ingitdb.yaml file from the referenced directory and imports all its rootCollections with the namespace prefix prepended.

baseDirPath is the directory containing the current .ingitdb.yaml file.

Returns an error if:

  • The referenced directory does not exist
  • The referenced directory has no .ingitdb.yaml file
  • The referenced .ingitdb.yaml has no or empty rootCollections

func (*RootConfig) Validate

func (rc *RootConfig) Validate() error

type SubscribersConfig added in v0.24.3

type SubscribersConfig struct {
	Subscribers map[string]*ingitdb.SubscriberDef `yaml:"subscribers,omitempty"`
}

func (*SubscribersConfig) Validate added in v0.24.3

func (sc *SubscribersConfig) Validate() error

Jump to

Keyboard shortcuts

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