aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/service/pages/resource_mon_page.h
blob: f6ab67200e4d7ac4875c5ff5efa4e8f3c12a9c08 (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
#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)
            : IMonPage(path, "")
            , ResourceName(resourceName)
            , ResourceType(resourceType)
        {
        }

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

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

    private:
        TString ResourceName;
        EResourceType ResourceType;
    };

}