blob: c0deed6cb1c784f9593e36b7c69c3bec4964340d [file] [log] [blame]
Scott Baker2c1c4822019-10-16 11:02:41 -07001/*
Joey Armstrong7f8436c2023-07-09 20:23:27 -04002 * Copyright 2020-2023 Open Networking Foundation (ONF) and the ONF Contributors
Scott Baker2c1c4822019-10-16 11:02:41 -07003
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7
8 * http://www.apache.org/licenses/LICENSE-2.0
9
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Himani Chawla4d2eb5d2020-11-12 17:19:20 +053017package eventif
Scott Baker2c1c4822019-10-16 11:02:41 -070018
19import (
Neha Sharma94f16a92020-06-26 04:17:55 +000020 "context"
khenaidoo26721882021-08-11 17:42:52 -040021
22 "github.com/opencord/voltha-protos/v5/go/voltha"
Scott Baker2c1c4822019-10-16 11:02:41 -070023)
24
25// EventProxy interface for eventproxy
26type EventProxy interface {
Neha Sharma94f16a92020-06-26 04:17:55 +000027 SendDeviceEvent(ctx context.Context, deviceEvent *voltha.DeviceEvent, category EventCategory,
Scott Baker2c1c4822019-10-16 11:02:41 -070028 subCategory EventSubCategory, raisedTs int64) error
kesavandd85e52b2022-03-15 16:38:08 +053029 SendDeviceEventWithKey(ctx context.Context, deviceEvent *voltha.DeviceEvent, category EventCategory,
30 subCategory EventSubCategory, raisedTs int64, key string) error
Neha Sharma94f16a92020-06-26 04:17:55 +000031 SendKpiEvent(ctx context.Context, id string, deviceEvent *voltha.KpiEvent2, category EventCategory,
Naga Manjunath86e9d2e2019-10-25 15:21:49 +053032 subCategory EventSubCategory, raisedTs int64) error
Himani Chawla4d2eb5d2020-11-12 17:19:20 +053033 SendRPCEvent(ctx context.Context, id string, deviceEvent *voltha.RPCEvent, category EventCategory,
34 subCategory *EventSubCategory, raisedTs int64) error
Matteo Scandolo2ca74462021-03-01 14:03:17 -080035 EnableLivenessChannel(ctx context.Context, enable bool) chan bool
36 SendLiveness(ctx context.Context) error
khenaidoo26721882021-08-11 17:42:52 -040037 Start() error
38 Stop()
Scott Baker2c1c4822019-10-16 11:02:41 -070039}
40
41const (
42 EventTypeVersion = "0.1"
43)
44
45type (
serkant.uluderyab38671c2019-11-01 09:35:38 -070046 EventType = voltha.EventType_Types
47 EventCategory = voltha.EventCategory_Types
48 EventSubCategory = voltha.EventSubCategory_Types
Scott Baker2c1c4822019-10-16 11:02:41 -070049)