khenaidoo | d948f77 | 2021-08-11 17:49:24 -0400 | [diff] [blame] | 1 | /* |
Mahir Gunyel | 4b93c07 | 2023-07-21 11:55:08 +0300 | [diff] [blame] | 2 | * Copyright 2020-2023 Open Networking Foundation (ONF) and the ONF Contributors |
khenaidoo | d948f77 | 2021-08-11 17:49:24 -0400 | [diff] [blame] | 3 | |
| 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 | |
| 17 | package eventif |
| 18 | |
| 19 | import ( |
| 20 | "context" |
| 21 | |
| 22 | "github.com/opencord/voltha-protos/v5/go/voltha" |
| 23 | ) |
| 24 | |
| 25 | // EventProxy interface for eventproxy |
| 26 | type EventProxy interface { |
| 27 | SendDeviceEvent(ctx context.Context, deviceEvent *voltha.DeviceEvent, category EventCategory, |
| 28 | subCategory EventSubCategory, raisedTs int64) error |
kesavand | 92fac10 | 2022-03-16 12:33:06 +0530 | [diff] [blame] | 29 | SendDeviceEventWithKey(ctx context.Context, deviceEvent *voltha.DeviceEvent, category EventCategory, |
| 30 | subCategory EventSubCategory, raisedTs int64, key string) error |
khenaidoo | d948f77 | 2021-08-11 17:49:24 -0400 | [diff] [blame] | 31 | SendKpiEvent(ctx context.Context, id string, deviceEvent *voltha.KpiEvent2, category EventCategory, |
| 32 | subCategory EventSubCategory, raisedTs int64) error |
| 33 | SendRPCEvent(ctx context.Context, id string, deviceEvent *voltha.RPCEvent, category EventCategory, |
| 34 | subCategory *EventSubCategory, raisedTs int64) error |
| 35 | EnableLivenessChannel(ctx context.Context, enable bool) chan bool |
| 36 | SendLiveness(ctx context.Context) error |
| 37 | Start() error |
| 38 | Stop() |
| 39 | } |
| 40 | |
| 41 | const ( |
| 42 | EventTypeVersion = "0.1" |
| 43 | ) |
| 44 | |
| 45 | type ( |
| 46 | EventType = voltha.EventType_Types |
| 47 | EventCategory = voltha.EventCategory_Types |
| 48 | EventSubCategory = voltha.EventSubCategory_Types |
| 49 | ) |