summaryrefslogtreecommitdiffstats
path: root/lib/layer/cache.c
blob: a532efdfe129e86584218656633baea9fe7b3703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*  Copyright (C) 2017 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 *  SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "lib/module.h"
#include "lib/cache/api.h"

/** Module implementation. */
int cache_init(struct kr_module *self)
{
	static const kr_layer_api_t layer = {
		.produce = &cache_peek,
		.consume = &cache_stash,
	};
	self->layer = &layer;
	return kr_ok();
}

KR_MODULE_EXPORT(cache) /* useless for builtin module, but let's be consistent */