aboutsummaryrefslogtreecommitdiffstats
path: root/vbench/src/vbench/http/http_result_handler.h
blob: 71a3c7722755a4c21da57d52b315249ffac5184e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vbench/core/string.h>
#include <vespa/vespalib/data/memory.h>

namespace vbench {

using Memory = vespalib::Memory;

/**
 * Callback interface that must be implemented in order to use the
 * http client.
 **/
struct HttpResultHandler
{
    virtual void handleHeader(const string &name, const string &value) = 0;
    virtual void handleContent(const Memory &data) = 0;
    virtual void handleFailure(const string &reason) = 0;
    virtual ~HttpResultHandler() {}
};

} // namespace vbench