VOL-1900 lint warning fixes ro_core
Change-Id: I5ce82f2d188d215ba9620d0923a1101ed4e5e4a8
diff --git a/ro_core/core/grpc_nbi_api_handler.go b/ro_core/core/grpc_nbi_api_handler.go
index 335623d..ee8d736 100644
--- a/ro_core/core/grpc_nbi_api_handler.go
+++ b/ro_core/core/grpc_nbi_api_handler.go
@@ -13,11 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package core
import (
"context"
"errors"
+
"github.com/golang/protobuf/ptypes/empty"
da "github.com/opencord/voltha-go/common/core/northbound/grpc"
"github.com/opencord/voltha-lib-go/v2/pkg/log"
@@ -30,6 +32,7 @@
"google.golang.org/grpc/status"
)
+// APIHandler represents API handler related information
type APIHandler struct {
commonMgr *ModelProxyManager
deviceMgr *DeviceManager
@@ -37,6 +40,7 @@
da.DefaultAPIHandler
}
+// NewAPIHandler creates API handler
func NewAPIHandler(generalMgr *ModelProxyManager, deviceMgr *DeviceManager, lDeviceMgr *LogicalDeviceManager) *APIHandler {
handler := &APIHandler{
commonMgr: generalMgr,
@@ -73,7 +77,8 @@
}
}
-func (handler *APIHandler) UpdateLogLevel(ctx context.Context, logging *voltha.Logging) (*empty.Empty, error) {
+// UpdateLogLevel updates log level to the requested level in specific packaged if mentioned
+func (*APIHandler) UpdateLogLevel(ctx context.Context, logging *voltha.Logging) (*empty.Empty, error) {
log.Debugw("UpdateLogLevel-request", log.Fields{"package": logging.PackageName, "intval": int(logging.Level)})
out := new(empty.Empty)
if logging.PackageName == "" {
@@ -88,7 +93,8 @@
return out, nil
}
-func (aa APIHandler) GetLogLevels(ctx context.Context, in *voltha.LoggingComponent) (*voltha.Loggings, error) {
+// GetLogLevels returns log levels for requested packages
+func (APIHandler) GetLogLevels(ctx context.Context, in *voltha.LoggingComponent) (*voltha.Loggings, error) {
logLevels := &voltha.Loggings{}
// do the per-package log levels
@@ -157,7 +163,7 @@
out := &voltha.IDs{Items: make([]*voltha.ID, 0)}
return out, nil
}
- return handler.deviceMgr.ListDeviceIds()
+ return handler.deviceMgr.ListDeviceIDs()
}
// ListDevicePorts returns the ports details for a specific device entry
@@ -287,6 +293,7 @@
return handler.logicalDeviceMgr.ListLogicalDeviceFlowGroups(ctx, id.Id)
}
+// SelfTest - TODO
func (handler *APIHandler) SelfTest(ctx context.Context, id *voltha.ID) (*voltha.SelfTestResponse, error) {
log.Debugw("SelfTest-request", log.Fields{"id": id})
if isTestMode(ctx) {
@@ -296,7 +303,7 @@
return nil, errors.New("UnImplemented")
}
-//@TODO useless stub, what should this actually do?
+// GetAlarmDeviceData - @TODO useless stub, what should this actually do?
func (handler *APIHandler) GetAlarmDeviceData(
ctx context.Context,
in *common.ID,
@@ -305,7 +312,7 @@
return nil, nil
}
-//@TODO useless stub, what should this actually do?
+// GetMeterStatsOfLogicalDevice - @TODO useless stub, what should this actually do?
func (handler *APIHandler) GetMeterStatsOfLogicalDevice(
ctx context.Context,
in *common.ID,
@@ -314,7 +321,7 @@
return nil, nil
}
-//@TODO useless stub, what should this actually do?
+// GetMibDeviceData - @TODO useless stub, what should this actually do?
func (handler *APIHandler) GetMibDeviceData(
ctx context.Context,
in *common.ID,
@@ -323,7 +330,7 @@
return nil, nil
}
-//@TODO useless stub, what should this actually do?
+// SimulateAlarm - @TODO useless stub, what should this actually do?
func (handler *APIHandler) SimulateAlarm(
ctx context.Context,
in *voltha.SimulateAlarmRequest,