org.cloudhoist:haproxy

Pallet - parent pom

License

License

GroupId

GroupId

org.cloudhoist
ArtifactId

ArtifactId

haproxy
Last Version

Last Version

0.7.0
Release Date

Release Date

Type

Type

jar
Description

Description

Pallet - parent pom
Source Code Management

Source Code Management

https://github.com/pallet/haproxy-crate

Download haproxy

How to add to project

<!-- https://jarcasting.com/artifacts/org.cloudhoist/haproxy/ -->
<dependency>
    <groupId>org.cloudhoist</groupId>
    <artifactId>haproxy</artifactId>
    <version>0.7.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.cloudhoist/haproxy/
implementation 'org.cloudhoist:haproxy:0.7.0'
// https://jarcasting.com/artifacts/org.cloudhoist/haproxy/
implementation ("org.cloudhoist:haproxy:0.7.0")
'org.cloudhoist:haproxy:jar:0.7.0'
<dependency org="org.cloudhoist" name="haproxy" rev="0.7.0">
  <artifact name="haproxy" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.cloudhoist', module='haproxy', version='0.7.0')
)
libraryDependencies += "org.cloudhoist" % "haproxy" % "0.7.0"
[org.cloudhoist/haproxy "0.7.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.clojure : core.incubator jar 0.1.0
org.clojure : clojure jar 1.2.1
org.cloudhoist : pallet jar 0.7.0-beta.1

test (1)

Group / Artifact Type Version
org.cloudhoist : pallet-crates-test jar 0.7.0

Project Modules

There are no modules declared in this project.

Repository · Issues · API docs · Annotated source · Release Notes

A pallet crate to install and configure haproxy.

Dependency Information

:dependencies [[com.palletops/haproxy-crate "0.8.0-alpha.3"]]

Releases

Pallet Crate Version Repo GroupId
0.8.0-RC.4 0.8.0-alpha.3 clojars com.palletops Release Notes Source

Usage

The haproxy crate provides a server-spec function that returns a server-spec. This server spec will install and run the haproxy server. You pass a map of options to configure haproxy, as specified in settings.

The server-spec provides an easy way of using the crate functions, and you can use the following crate functions directly if you need to.

The settings function provides a plan function that should be called in the :settings phase. The function puts the configuration options into the pallet session, where they can be found by the other crate functions, or by other crates wanting to interact with haproxy.

The :proxy-group keyword can be used to provide a logical name the haproxy instance, and defaults to pallet group name.

The haproxy configuration file is based on the :config key in the settings map, and has four sub-keys, The :listen sub-key is used to specific a map of applications to proxy, where the key is a keyword naming the application, and the values are a map of configuration options for the listen clause for that application.

For example, this would configure a :my-app application, listening on port 80.

{:proxy-group :myproxy
 :config {:listen {:myapp {:server-address "0.0.0.0:80"}}}}

The :frontend and :backend keys can also be used to define an application, e.g.

{:proxy-group :myproxy
 :config {:frontend {:myapp {:server-address "0.0.0.0:80"}}
          :backend {:myapp {}}}}

The proxied-by function should be called in the settings phase of services that want to be proxied behind haproxy. The :proxy-group setting, which defaults to the group-name for the current target, should match the proxy-group-name argument passed to proxied-by.

For example, this would add the current target as a server for the :my-app application, contactable on the 8080 port.

(haproxy/proxied-by :proxy-group :myapp {:server-port 8080})

When the :listen key is used to set up the application, this will result in server entries under in the listen configuration section. When a :backend key is used to set up the application, this will result in server entries under the backend configuration section.

The install function is responsible for actually installing haproxy.

Live test on vmfest

For example, to run the live test on VMFest, using Ubuntu 13:

lein with-profile +vmfest pallet up --selectors ubuntu-13
lein with-profile +vmfest pallet down --selectors ubuntu-13

License

Copyright (C) 2012, 2013 Hugo Duncan

Distributed under the Eclipse Public License.

org.cloudhoist

pallet

Versions

Version
0.7.0
0.6.0
0.5.0
0.4.3
0.4.2
0.4.1
0.4.0
0.4.0-beta-1