Skip to content

Commit 96959ac

Browse files
authored
Introduce a BaseScanner class (#121)
This will help us refactor and standarize all scanners. Additionally this class create a good place to have common method which are deuplicated in many places.
1 parent e19cf6c commit 96959ac

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
import logging
19+
from abc import abstractmethod
20+
21+
from kibble.scanners.brokers.kibbleES import KibbleBit
22+
23+
24+
class BaseScanner:
25+
"""
26+
Base scanner class. All scanners should inherit from it.
27+
"""
28+
29+
version: str
30+
title: str
31+
log = logging.getLogger(__name__)
32+
33+
@abstractmethod
34+
def scan(self, kibble_bit: KibbleBit, source: dict) -> None:
35+
raise NotImplementedError

0 commit comments

Comments
 (0)