pallet.version-dispatch documentation

Dispatch that is version aware.

A version is a dotted string, e.g. "1.0.3", which is represented as a vector [1 0 3].

A version specification is either a version vector, which matches a single version (and all point versions thereof), or a vector of two elements, specifying an inclusive version range. A nil in the version vector signifies an open end to the range.

The basic idea is that you wish to dispatch on hierarchy where the dispatched data may provide a version.

defmethod-version

macro

[multi-version {:keys [os os-version version], :as dispatch-value} [& args] & body]

Adds a method to the specified multi-version function for the specified dispatch-value.

defmethod-version-plan

macro

[multi-version {:keys [os os-version version], :as dispatch-value} [& args] & body]

Adds a method to the specified multi-version function for the specified dispatch-value.

defmulti-version

macro

[name [os os-version version & args] hierarchy-place]

Defines a multi-version function used to abstract over an operating system hierarchy, where dispatch includes an optional os-version. The version refers to a software package version of some sort, on the specified os and os-version.

defmulti-version-plan

macro

[name [version & args]]

Defines a multi-version function used to abstract over an operating system hierarchy, where dispatch includes an optional os-version. The version refers to a software package version of some sort, on the specified os and os-version.

hierarchy-vals

fn

[hierarchy]

Returns all values in a hierarchy, whether parents or children.

os-map

fn

[{:as os-value-pairs}]

Construct an os version map. The keys should be maps with :os-family and :os-version keys. The :os-family value should be take from the os-hierarchy. The :os-version should be a version vector, or a version range vector.