aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/fetchers/cache.hh
blob: ba2d306294062bf347ba7ea797e21fdd1efffc46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include "types.hh"
#include "fetchers/fetchers.hh"

namespace nix::fetchers {

struct Cache
{
    virtual void add(
        ref<Store> store,
        const Attrs & inAttrs,
        const Attrs & infoAttrs,
        const StorePath & storePath,
        bool immutable) = 0;

    virtual std::optional<std::pair<Attrs, StorePath>> lookup(
        ref<Store> store,
        const Attrs & inAttrs) = 0;
};

ref<Cache> getCache();

}