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
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 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
Click to show internal directories.
Click to hide internal directories.