-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.cfg
87 lines (75 loc) · 3.21 KB
/
example.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# This is an example ellycache configuration file with all possible options.
# Use this as a starting point to create your own configuration file.
# Syntax of this file:
# * The file itself is in HCL (https://github.com/hashicorp/hcl) format.
# * Strings are enclosed in double quotes, and you can use escape sequences
# like \", \n etc. Heredoc syntax can also be used.
# * Durations are of the format "NNhNNmNNs" where h, m and s stand for hours,
# minutes and seconds respectively, with at least one of them present.
# The address to listen on. The format is "host:port", "ipv4:port" or
# "[ipv6]:port". Omitting the host binds to all interfaces. The default is
# ":8080".
listen = ":8080"
#listen = "127.0.0.1:8080"
#listen = "[::1]:8080"
#listen = "10.0.23.1:8081"
# The connection block defines parameters for the PostgreSQL connection pool.
# This block is required.
connection {
# The PostgreSQL DSN to connect to. The format is libpq-style key-value
# pairs separated by spaces. There is no default. ellycache understands
# pgpass files and PG* environment variables.
dsn = "host=myhost port=myport user=myuser password=mypass dbname=mydb"
#dsn = "host=/var/run/postgresql port=5432 user=analytics dbname=posts"
#dsn = "host=pgbouncer.example.com port=6432 dbname=foobar"
# The maximum number of concurrent active connections. Optional, defaults
# to 5.
maxconns = 10
# The maximum duration a connection can be idle before it is closed. If
# omitted, idle connections are NOT closed.
idletimeout = "5m"
}
# The endpoint block defines a single URI served by ellycache. At least one
# endpoint block is required. The URI path should be absolute, and specified
# as a string parameter for the block.
endpoint "/foobar" {
# The SQL command, whose results are cached and served at this URI. This
# is a required parameter.
sql = "SELECT * FROM foobar"
# The query timeout for the SQL query above. Optional. If not specified,
# no timeout is enforced by ellycache.
sqltimeout = "1m"
# The schedule to execute this query, in standard cron syntax specified
# here: https://en.wikipedia.org/wiki/Cron. The '@' format ("@every 1h" etc)
# is also supported. This is a required parameter.
schedule = "*/10 * * * *"
# Each row can be represented as an array or an object in the returned json.
# Use "array" (the default) or "object" as the value for this parameter.
rowformat = "array"
# If the filebacked parameter is set to true, then the result is not cached
# in memory, but stored in an encrypted temporary file instead. Use this for
# large query results. Optional, defaults to false.
filebacked = true
}
# Another endpoint block, showing a SQL query in heredoc syntax, and a schedule
# in the '@' format.
endpoint "/pagila/rentals/late" {
sql = <<EOLATE
SELECT
CONCAT(customer.last_name, ', ', customer.first_name) AS customer,
address.phone,
film.title
FROM
rental
INNER JOIN customer ON rental.customer_id = customer.customer_id
INNER JOIN address ON customer.address_id = address.address_id
INNER JOIN inventory ON rental.inventory_id = inventory.inventory_id
INNER JOIN film ON inventory.film_id = film.film_id
WHERE
rental.return_date IS NULL
AND rental_date < CURRENT_DATE
ORDER BY
title
EOLATE
schedule = "@every 1h"
}