summaryrefslogtreecommitdiffstats
path: root/lib/layer/cache.c
blob: 2f1ba6057780fd40f9c6877e2c65d5a7edc350ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*  Copyright (C) CZ.NIC, z.s.p.o. <knot-resolver@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 */