The piggyback-parameters Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The piggyback-parameters Reference Manual

This is the piggyback-parameters Reference Manual, version 0.1.5, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Mon Jul 29 16:24:49 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Piggyback Parameters Manual

[in package PIGGYBACK-PARAMETERS]

pipeline status Quicklisp coverage report

Description

This is a parameter system that supports local file and database parameter storage. The library trivial-pooled-database is used to handle the connection and must be initialized prior to reading any parameters from the database. See section Working Example.
Loading this parameters from the local configuration file is possible using the :local-only strategy.

The database table for storing parameters must be created with following SQL statement

CREATE TABLE `_OPTIONS_` (
  `parameter` varchar(64) NOT NULL,
  `value` varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Installing piggyback-parameters

This project is available in the latest QuickLisp distribution, so installing it is reduced to calling:

(ql:quickload :piggyback-parameters)

Working Example

First load local configuration file.

(piggyback-parameters:load-config (uiop/common-lisp:merge-pathnames #P"config" (asdf:system-source-directory :some_project)))

Now it is possible to use the loaded parameters to initialize the DB connection.

(let ((username (piggyback-parameters:get-value :username :file-only))
	(passwd (piggyback-parameters:get-value :passwd :file-only))
	(schema (piggyback-parameters:get-value :schema :file-only))
	(host (piggyback-parameters:get-value :host :file-only)))
  (log:info "Initializing DB Connections Pool (~a ~a ~a ~a)"  username passwd schema host)
  (trivial-pooled-database:initialize-connection-pool username passwd schema host))

Let's save some parameter in the DB...

(setf (piggyback-parameters:get-value :enabled-plugins :database-only) '("plugin-a" "plugin-b" "plugin-c"))

... and at some later point read them back.

(loop for plugin in (piggyback-parameters:get-value :enabled-plugins)
   do (log:info "Loading plugin '~a'." plugin))

Exported Symbols

License Information

This library is released under the MIT License. Please refer to the LICENSE to get the full licensing text.

Contributing to this project

Please refer to the CONTRIBUTING document for more information.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 piggyback-parameters

Author

Eric Diethelm <ediethelm@yahoo.com>

License

MIT

Description

This is a configuration system that supports local file and database based parameter storage.

Version

0.1.5

Dependencies
Source

piggyback-parameters.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 piggyback-parameters.asd

Location

piggyback-parameters.asd

Systems

piggyback-parameters (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 piggyback-parameters/package.lisp

Parent

piggyback-parameters (system)

Location

package.lisp

Packages

piggyback-parameters


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 piggyback-parameters/piggyback-parameters.lisp

Parent

piggyback-parameters (system)

Location

piggyback-parameters.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 piggyback-parameters/documentation.lisp

Parent

piggyback-parameters (system)

Location

documentation.lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 piggyback-parameters

piggyback-parameters is a parameter system that supports local file and database parameter storage.

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: @piggyback-parameters-contributing
Package

piggyback-parameters

Source

documentation.lisp (file)

Special Variable: @piggyback-parameters-description
Package

piggyback-parameters

Source

documentation.lisp (file)

Special Variable: @piggyback-parameters-example
Package

piggyback-parameters

Source

documentation.lisp (file)

Special Variable: @piggyback-parameters-exported
Package

piggyback-parameters

Source

documentation.lisp (file)

Special Variable: @piggyback-parameters-installing
Package

piggyback-parameters

Source

documentation.lisp (file)

Special Variable: @piggyback-parameters-license
Package

piggyback-parameters

Source

documentation.lisp (file)

Special Variable: @piggyback-parameters-manual
Package

piggyback-parameters

Source

documentation.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: clear-parameter PARAMETER

Remove the parameter from memory (aka unload).

Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Function: delete-parameter PARAMETER FROM
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Function: get-value PARAMETER &optional STRATEGY FORCE

Read the value of paramter *PARAM*. The source of the value can be defined by *STRATEGY*, which accepts following values
**nil** Reuse the same strategy as in the previous get/set of this parameter;
**:file-first** Load the value first from the local configuration and, if it does not exist, from the database;
**:db-first** Load the value first from the database and, if it does not exist, from the local configuration;
**:try-append** Load the values both from database and from local configuration and try to append them (valid types are only *list* and *string*); **:file-only** Load the value only from the local configuration file;
**:db-only** Load the value only from the database.

Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Writer

(setf get-value) (function)

Function: (setf get-value) VALUE PARAMETER &optional STRATEGY

Save the parameter *PARAMETER* with value *VALUE* into storage. The storage destination is defined by the parameter *STRATEGY* with possible values being **nil** Reuse the same strategy as in the previous get/set of this parameter;
**:local-only** Save the parameter/value pair only in the local configuration file;
**:database-only** Save the parameter/value pair only in the database.

Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Reader

get-value (function)

Function: set-configuration-file PATH

Define the path of the configuration file to be used in combination with the :file-only and :file-first strategies.

Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Conditions

Condition: file-not-found-error ()
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Direct superclasses

error (condition)

Direct methods

path (method)

Direct slots
Slot: path
Initargs

:path

Readers

path (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *config-file*
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Special Variable: *parameters*
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: find-parameter KEY
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Function: load-file PATH
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Function: save-file PATH
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Function: try-merge FVAL SVAL
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: get-key OBJECT
Package

piggyback-parameters

Methods
Method: get-key (CONFIG-PARAMETER config-parameter)

automatically generated reader method

Source

piggyback-parameters.lisp (file)

Generic Function: load-value PARAMETER STRATEGY
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Methods
Method: load-value PARAMETER (STRATEGY (eql database-first))
Method: load-value PARAMETER (STRATEGY (eql file-first))
Method: load-value PARAMETER (STRATEGY (eql memory-only))
Method: load-value PARAMETER (STRATEGY (eql file-only))
Method: load-value PARAMETER (STRATEGY (eql database-only))
Generic Function: path CONDITION
Package

piggyback-parameters

Methods
Method: path (CONDITION file-not-found-error)
Source

piggyback-parameters.lisp (file)

Generic Function: save-value PARAMETER STRATEGY VALUE
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Methods
Method: save-value PARAMETER (STRATEGY (eql database-first)) VALUE
Method: save-value PARAMETER (STRATEGY (eql file-first)) VALUE
Method: save-value PARAMETER (STRATEGY (eql memory-only)) VALUE
Method: save-value PARAMETER (STRATEGY (eql file-only)) VALUE
Method: save-value PARAMETER (STRATEGY (eql database-only)) VALUE
Generic Function: strategy OBJECT
Package

piggyback-parameters

Methods
Method: strategy (CONFIG-PARAMETER config-parameter)

automatically generated reader method

Source

piggyback-parameters.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Classes

Class: config-parameter ()
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: key
Initargs

:key

Initform

(function (lambda nil (error "the configuration parameter must have a key (the parameter name).")))

Readers

get-key (generic function)

Slot: value
Initargs

:value

Slot: read-strategy
Type

(member :memory-only :file-first :database-first :file-only :database-only)

Initargs

:strategy

Initform

:file-first

Readers

strategy (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   P  
Index Entry  Section

F
File, Lisp, piggyback-parameters.asd: The piggyback-parameters<dot>asd file
File, Lisp, piggyback-parameters/documentation.lisp: The piggyback-parameters/documentation<dot>lisp file
File, Lisp, piggyback-parameters/package.lisp: The piggyback-parameters/package<dot>lisp file
File, Lisp, piggyback-parameters/piggyback-parameters.lisp: The piggyback-parameters/piggyback-parameters<dot>lisp file

L
Lisp File, piggyback-parameters.asd: The piggyback-parameters<dot>asd file
Lisp File, piggyback-parameters/documentation.lisp: The piggyback-parameters/documentation<dot>lisp file
Lisp File, piggyback-parameters/package.lisp: The piggyback-parameters/package<dot>lisp file
Lisp File, piggyback-parameters/piggyback-parameters.lisp: The piggyback-parameters/piggyback-parameters<dot>lisp file

P
piggyback-parameters.asd: The piggyback-parameters<dot>asd file
piggyback-parameters/documentation.lisp: The piggyback-parameters/documentation<dot>lisp file
piggyback-parameters/package.lisp: The piggyback-parameters/package<dot>lisp file
piggyback-parameters/piggyback-parameters.lisp: The piggyback-parameters/piggyback-parameters<dot>lisp file

Jump to:   F   L   P  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
C   D   F   G   L   M   P   S   T  
Index Entry  Section

(
(setf get-value): Exported functions

C
clear-parameter: Exported functions

D
delete-parameter: Exported functions

F
find-parameter: Internal functions
Function, (setf get-value): Exported functions
Function, clear-parameter: Exported functions
Function, delete-parameter: Exported functions
Function, find-parameter: Internal functions
Function, get-value: Exported functions
Function, load-file: Internal functions
Function, save-file: Internal functions
Function, set-configuration-file: Exported functions
Function, try-merge: Internal functions

G
Generic Function, get-key: Internal generic functions
Generic Function, load-value: Internal generic functions
Generic Function, path: Internal generic functions
Generic Function, save-value: Internal generic functions
Generic Function, strategy: Internal generic functions
get-key: Internal generic functions
get-key: Internal generic functions
get-value: Exported functions

L
load-file: Internal functions
load-value: Internal generic functions
load-value: Internal generic functions
load-value: Internal generic functions
load-value: Internal generic functions
load-value: Internal generic functions
load-value: Internal generic functions

M
Method, get-key: Internal generic functions
Method, load-value: Internal generic functions
Method, load-value: Internal generic functions
Method, load-value: Internal generic functions
Method, load-value: Internal generic functions
Method, load-value: Internal generic functions
Method, path: Internal generic functions
Method, save-value: Internal generic functions
Method, save-value: Internal generic functions
Method, save-value: Internal generic functions
Method, save-value: Internal generic functions
Method, save-value: Internal generic functions
Method, strategy: Internal generic functions

P
path: Internal generic functions
path: Internal generic functions

S
save-file: Internal functions
save-value: Internal generic functions
save-value: Internal generic functions
save-value: Internal generic functions
save-value: Internal generic functions
save-value: Internal generic functions
save-value: Internal generic functions
set-configuration-file: Exported functions
strategy: Internal generic functions
strategy: Internal generic functions

T
try-merge: Internal functions

Jump to:   (  
C   D   F   G   L   M   P   S   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   @  
K   P   R   S   V  
Index Entry  Section

*
*config-file*: Internal special variables
*parameters*: Internal special variables

@
@piggyback-parameters-contributing: Exported special variables
@piggyback-parameters-description: Exported special variables
@piggyback-parameters-example: Exported special variables
@piggyback-parameters-exported: Exported special variables
@piggyback-parameters-installing: Exported special variables
@piggyback-parameters-license: Exported special variables
@piggyback-parameters-manual: Exported special variables

K
key: Internal classes

P
path: Exported conditions

R
read-strategy: Internal classes

S
Slot, key: Internal classes
Slot, path: Exported conditions
Slot, read-strategy: Internal classes
Slot, value: Internal classes
Special Variable, *config-file*: Internal special variables
Special Variable, *parameters*: Internal special variables
Special Variable, @piggyback-parameters-contributing: Exported special variables
Special Variable, @piggyback-parameters-description: Exported special variables
Special Variable, @piggyback-parameters-example: Exported special variables
Special Variable, @piggyback-parameters-exported: Exported special variables
Special Variable, @piggyback-parameters-installing: Exported special variables
Special Variable, @piggyback-parameters-license: Exported special variables
Special Variable, @piggyback-parameters-manual: Exported special variables

V
value: Internal classes

Jump to:   *   @  
K   P   R   S   V  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   F   P   S  
Index Entry  Section

C
Class, config-parameter: Internal classes
Condition, file-not-found-error: Exported conditions
config-parameter: Internal classes

F
file-not-found-error: Exported conditions

P
Package, piggyback-parameters: The piggyback-parameters package
piggyback-parameters: The piggyback-parameters system
piggyback-parameters: The piggyback-parameters package

S
System, piggyback-parameters: The piggyback-parameters system

Jump to:   C   F   P   S