This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3651 from kodebach/kodebach/issue2764
Integrate kdbEnsure into kdbOpen
- Loading branch information
Showing
163 changed files
with
4,881 additions
and
2,790 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# KDB Contracts | ||
|
||
The `kdbOpen()` function accepts a `KeySet * contract` parameter. | ||
This parameter allows you to extend and configure the KDB within your application without permanently changing files on disk. | ||
|
||
## Contract Structure | ||
|
||
The contract consists of Keys below `system:/elektra/contract/<type>`, where `<type>` is one of a set of predefined contract types. | ||
Currently, the types `globalkeyset` and `mountglobal` are supported. | ||
|
||
### Global KeySet Contracts | ||
|
||
To insert data into the global KeySet during `kdbOpen`, you can add keys below `system:/elektra/contract/globalkeyset`. | ||
All these keys will be renamed and copied into the global KeySet that is passed to all plugins. | ||
|
||
Specifically, the subset below `system:/elektra/contract/globalkeyset` is moved to `system:/elektra` and then inserted into the global KeySet. | ||
|
||
### Mounting Global Plugins | ||
|
||
You can also mount a global plugin with a contract. | ||
To do this, add a key `system:/elektra/contract/mountglobal/<plugin>` where `<plugin>` is the name of the plugin you want to mount. | ||
The keys below `system:/elektra/contract/mountglobal/<plugin>` will be moved to `user:/` and used as the config for `<plugin>`. | ||
|
||
## Pre-defined Contracts | ||
|
||
There are a few pre-defined contracts that can be accessed via helper functions. | ||
|
||
### GOpts | ||
|
||
To mount and configure the `gopts` plugin you can use `elektraGOptsContract`. | ||
There is also `elektraGOptsContractFromStrings`, but its use is discouraged unless you really need it. | ||
It mainly exists for use from various bindings. | ||
|
||
### I/O binding | ||
|
||
To set the I/O binding to be used in a KDB instance, use `elektraIoContract`. | ||
|
||
### Notification | ||
|
||
To set up notifications use the `elektraNotificationContract` function. | ||
It automatically sets up the `internalnotification` plugin. | ||
|
||
If you also need to set up notification transport plugins, you should manually add the relevant `system:/elektra/contract/mountglobal/<plugin>` keys and the required config below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.