aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/service/pages/resource_mon_page.h
blob: bc8b152f4f52ddfa84696ed6c1e5161a77887554 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once

#include "mon_page.h"

#include <library/cpp/resource/resource.h>

namespace NMonitoring {
    struct TResourceMonPage: public IMonPage {
    public:
        enum EResourceType {
            BINARY,
            TEXT,
            JSON,
            CSS,
            JAVASCRIPT,

            FONT_EOT,
            FONT_TTF,
            FONT_WOFF,
            FONT_WOFF2,

            PNG,
            SVG
        };

        TResourceMonPage(const TString& path, const TString& resourceName,
                         const EResourceType& resourceType = BINARY, const bool isCached = false)
            : IMonPage(path, "")
            , ResourceName(resourceName)
            , ResourceType(resourceType)
            , IsCached(isCached)
        {
        }

        void Output(NMonitoring::IMonHttpRequest& request) override;

        void NotFound(NMonitoring::IMonHttpRequest& request) const;

    private:
        TString ResourceName;
        EResourceType ResourceType;
        bool IsCached;
    };

}