.TH "md_src_plugins_README" 3elektra "Sun May 29 2016" "Version 0.8.14" "Elektra" \" -*- nroff -*- .ad l .nh .SH NAME md_src_plugins_README \- elektra-plugins(7) -- plugins overview Plugins can be mounted into the KDB and can access or manipulate the KeySet on every access\&. .PP Multiple plugins can be mounted into the \fBkey data base\fP\&. On every access to the key data base they are executed and thus can change the functionality\&. .SH "Introduction" .PP Elektra already has a wide range of different plugins\&. The plugin folders should contain a README\&.md with further information\&. (Or follow links below\&.) The plugins are: .PP Overview Plugins For background information see \fBelektra-plugins-framework(7)\fP\&. .PP .SS "C-Interface" .PP All plugins implement the same interface: .PP .IP "\(bu" 2 \fC\fBkdbOpen()\fP\fP calls \fCelektraPluginOpen()\fP of every plugin to let them do their initialisation\&. .IP "\(bu" 2 \fC\fBkdbGet()\fP\fP requests \fCelektraPluginGet()\fP of every plugin in the queried backends to return a key set\&. .IP "\(bu" 2 \fC\fBkdbSet()\fP\fP usually calls \fCelektraPluginSet()\fP of every plugin in the queried backends to store the configuration\&. .IP "\(bu" 2 \fC\fBkdbSet()\fP\fP also calls \fCelektraPluginError()\fP for every plugin when an error happens\&. Because of \fCelektraPluginError()\fP, plugins are guaranteed to have their chance for necessary cleanups\&. .IP "\(bu" 2 \fC\fBkdbClose()\fP\fP makes sure that plugins can finally free their own resources in \fCelektraPluginClose()\fP\&. .PP .PP .SS "KDB-Interface" .PP .IP "\(bu" 2 To list all plugins use \fBkdb-list(1)\fP\&. .IP "\(bu" 2 To check a plugin use \fBkdb-check(1)\fP\&. .IP "\(bu" 2 For information on a plugin use \fBkdb-info(1)\fP\&. .IP "\(bu" 2 For mount plugin(s) use \fBkdb-mount(1)\fP\&. .PP .PP .SS "See also" .PP For an easy introduction, see \fBthis tutorial how to write a storage plugin\fP\&. For more background information of the \fBplugin framework, continue here\fP\&. Otherwise, you can visit the \fCthe API documentation\fP\&. .PP .SH "Plugins" .PP .PP .SS "Resolver" .PP Before configuration is actually written, the file name needs to be determined (will be automatically added by kdb mount): .PP .IP "\(bu" 2 \fBresolver\fP uses POSIX APIs to handle conflicts gracefully .IP "\(bu" 2 \fBwresolver\fP minimalistic resolver for non-POSIX systems .IP "\(bu" 2 \fBnoresolver\fP does not resolve, but can act as one .PP .PP and afterwards the configuration file must be synced with harddisc (recommended to add at every kdb mount): .PP .IP "\(bu" 2 \fBsync\fP uses POSIX APIs to sync configuration file with harddisc .PP .PP .SS "Storage" .PP Are responsible for reading writing the configuration to configuration files\&. .PP Read and write everything a KeySet might contain: .PP .IP "\(bu" 2 \fBdump\fP makes a dump of a KeySet in an Elektra-specific format .PP .PP Read (and write) standard config files of /etc: .PP .IP "\(bu" 2 \fBaugeas\fP parses and generates many different configuration files using the augeas library .IP "\(bu" 2 \fBhosts\fP read/write hosts files .IP "\(bu" 2 \fBline\fP reads any file line by line .PP .PP Using semi-structured data for config files: .PP .IP "\(bu" 2 \fBtcl\fP-like config files (including meta data)\&. .IP "\(bu" 2 \fBni\fP parses INI files based on \fCni\fP\&. .IP "\(bu" 2 \fBini\fP parses INI files based on \fCinih\fP\&. .IP "\(bu" 2 \fBxmltool\fP uses XML\&. .IP "\(bu" 2 \fByajl\fP uses JSON\&. .PP .PP Plugins that just show some functionality, (currently) not intended for productive use: .PP .IP "\(bu" 2 \fBfstab\fP reads fstab files\&. .IP "\(bu" 2 \fBregexstore\fP .IP "\(bu" 2 \fBsimpleini\fP is ini without sections .IP "\(bu" 2 \fBcsvstorage\fP for csv files .PP .PP .SS "System Information" .PP Information compiled in Elektra: .IP "\(bu" 2 \fBversion\fP is a build-in plugin directly within the core so that it cannot give wrong version information .IP "\(bu" 2 \fBconstants\fP various constants, including version information .PP .PP Providing information found on the system not available in persistent files: .PP .IP "\(bu" 2 \fBuname\fP information from the uname syscall\&. .PP .PP .SS "Filter" .PP \fIFilter plugins\fP process keys and their values in both directions\&. In one direction they undo what they do in the other direction\&. Most filter plugins available now encode and decode values\&. Storage plugins that use characters to separate key names, values or metadata will not work without them\&. .PP .SS "Encoding" .PP Rewrite unwanted characters with different techniques: .PP .IP "\(bu" 2 \fBccode\fP using the technique from arrays in the programming language C .IP "\(bu" 2 \fBhexcode\fP using hex codes .PP .PP Transformations: .PP .IP "\(bu" 2 \fBkeytometa\fP transforms keys to metadata .IP "\(bu" 2 \fBrename\fP renames keys according to different rules .PP .PP Doing other stuff: .PP .IP "\(bu" 2 \fBcrypto\fP encrypts / decrypts confidential values .IP "\(bu" 2 \fBiconv\fP make sure the configuration will have correct character encoding .IP "\(bu" 2 \fBhidden\fP hides keys whose names start with a \fC\&.\fP\&. .IP "\(bu" 2 \fBnull\fP takes care of null values and other binary specialities .PP .PP .SS "Notification and Logging" .PP Log/Send out all changes to configuration to: .PP .IP "\(bu" 2 \fBdbus\fP .IP "\(bu" 2 \fBjournald\fP .IP "\(bu" 2 \fBsyslog\fP .IP "\(bu" 2 \fBlogchange\fP prints the change of every key on the console .PP .PP .SS "Debug" .PP Trace everything that happens within KDB: .PP .IP "\(bu" 2 \fBtimeofday\fP print timestamps .IP "\(bu" 2 \fBtracer\fP .IP "\(bu" 2 \fBcounter\fP count and print how often plugin is used .PP .PP .SS "Checker" .PP Copies meta data to keys: .PP .IP "\(bu" 2 \fBglob\fP using globbing techniques .IP "\(bu" 2 \fBstruct\fP using a defined structure (may also reject configuration not conforming to that structure) .PP .PP Plugins that check if values are valid based on meta data (typically copied by another plugin just before): .PP .IP "\(bu" 2 \fBvalidation\fP by using regex .IP "\(bu" 2 \fBnetwork\fP by using network APIs .IP "\(bu" 2 \fBpath\fP by checking files on filesystem .IP "\(bu" 2 \fBtype\fP using runtime type checking (CORBA types/) .IP "\(bu" 2 \fBenum\fP compares the keyvalue against a list of valid values .IP "\(bu" 2 \fBmathcheck\fP by mathematical expressions using keysvalues as operants .IP "\(bu" 2 \fBconditionals\fP by using if-then-else like statements .PP .PP .SS "Interpreter" .PP These plugins start an interpreter and allow you to use a bindings\&. .PP .IP "\(bu" 2 \fBjni\fP java plugins started by jni, works with jna plugins .IP "\(bu" 2 \fBpython\fP Python 3 plugins (technical preview/) .IP "\(bu" 2 \fBpython2\fP Python 2 plugins (technical preview, deprecated/) .IP "\(bu" 2 \fBlua\fP Lua plugins (technical preview/) .PP .PP .SS "Others" .PP .IP "\(bu" 2 \fBdoc\fP contains the documentation of the plugin interface .IP "\(bu" 2 \fBerror\fP yields errors as described in metadata (handy for test purposes) .IP "\(bu" 2 \fBtemplate\fP to be copied for new plugins .IP "\(bu" 2 \fBlineendings\fP tests file for consistent line endings .IP "\(bu" 2 \fBlist\fP loads other plugins .IP "\(bu" 2 \fBfilecheck\fP does sanity checks on a file .PP .PP To add a new plugin you can copy the template plugin\&. Please make sure to add your plugin: .PP .IP "\(bu" 2 to this list, at least in Others .IP "\(bu" 2 to \fBcmake\fP, at least in ALL .PP