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.4, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Mon Apr 08 14:45:55 2019 GMT+0.


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

1 Introduction

Piggyback Parameters Manual

[in package PIGGYBACK-PARAMETERS]

pipeline status Quicklisp

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 below. 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-config-param :username :strategy :local-only))
	(passwd (piggyback-parameters:get-config-param :passwd :strategy :local-only))
	(schema (piggyback-parameters:get-config-param :schema :strategy :local-only))
	(host (piggyback-parameters:get-config-param :host :strategy :local-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...

(piggyback-parameters:set-config-param :enabled-plugins '("plugin-a" "plugin-b" "plugin-c"))

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

(loop for plugin in (piggyback-parameters:get-config-param :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.4

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: get-config-param PARAM &key STRATEGY

Read the value of paramter *PARAM*. The source of the value can be defined by *STRATEGY*, which accepts following values
**:local-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*); **:local-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)

Function: load-config CONFIG-FILE

Load parameter/value pairs from the file *CONFIG-FILE*.

Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Function: set-config-param PARAM VALUE &key STRATEGY

Save the parameter *PARAM* with value *VALUE* into storage. The storage destination is defined by the parameter *STRATEGY* with possible values being **:local-only** Save the parameter/value pair only in the local configuration file;
**:db-only** Save the parameter/value pair only in the database.

Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Function: store-config CONFIG-FILE

Save all used parameter/value pairs into a file defined by *CONFIG-FILE*.

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: *parameters*
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)


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

5.2.2 Functions

Function: json-deserialize-fn LINE
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Function: json-serialize-fn STREAM KEY VALUE
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)


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

5.2.3 Generic functions

Generic Function: combination OBJECT
Package

piggyback-parameters

Methods
Method: combination (CONFIG-PARAMETERS config-parameters)

automatically generated reader method

Source

piggyback-parameters.lisp (file)

Generic Function: path CONDITION
Package

piggyback-parameters

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

piggyback-parameters.lisp (file)

Generic Function: strategy OBJECT
Package

piggyback-parameters

Methods
Method: strategy (CONFIG-PARAMETERS config-parameters)

automatically generated reader method

Source

piggyback-parameters.lisp (file)


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

5.2.4 Classes

Class: config-parameters ()
Package

piggyback-parameters

Source

piggyback-parameters.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: read-strategy
Type

(member :local-first :db-first :local-only :db-only)

Initargs

:strategy

Initform

:local-first

Readers

strategy (generic function)

Slot: combination-strategy
Type

(member :try-merge :dont-merge)

Initargs

:combination

Initform

:try-merge

Readers

combination (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   F   G   J   L   M   P   S  
Index Entry  Section

C
combination: Internal generic functions
combination: Internal generic functions

F
Function, get-config-param: Exported functions
Function, json-deserialize-fn: Internal functions
Function, json-serialize-fn: Internal functions
Function, load-config: Exported functions
Function, set-config-param: Exported functions
Function, store-config: Exported functions

G
Generic Function, combination: Internal generic functions
Generic Function, path: Internal generic functions
Generic Function, strategy: Internal generic functions
get-config-param: Exported functions

J
json-deserialize-fn: Internal functions
json-serialize-fn: Internal functions

L
load-config: Exported functions

M
Method, combination: Internal generic functions
Method, path: Internal generic functions
Method, strategy: Internal generic functions

P
path: Internal generic functions
path: Internal generic functions

S
set-config-param: Exported functions
store-config: Exported functions
strategy: Internal generic functions
strategy: Internal generic functions

Jump to:   C   F   G   J   L   M   P   S  

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

A.3 Variables

Jump to:   *   @  
C   P   R   S  
Index Entry  Section

*
*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

C
combination-strategy: Internal classes

P
path: Exported conditions

R
read-strategy: Internal classes

S
Slot, combination-strategy: Internal classes
Slot, path: Exported conditions
Slot, read-strategy: Internal classes
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

Jump to:   *   @  
C   P   R   S  

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

A.4 Data types

Jump to:   C   F   P   S  
Index Entry  Section

C
Class, config-parameters: Internal classes
Condition, file-not-found-error: Exported conditions
config-parameters: 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