common

package
v0.0.0-...-308df95 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2021 License: BSD-2-Clause, BSD-3-Clause, LGPL-2.1, + 2 more Imports: 8 Imported by: 0

Documentation

Overview

Copyright (c) 2019-2020, AT&T Intellectual Property. All rights reserved.

SPDX-License-Identifier: LGPL-2.1-only

Index

Constants

View Source
const (
	ConfigManagementFeature = "config-mgmt"
	LoadKeysFeature         = "loadkeys"
	RoutingInstanceFeature  = "routing-instance"
)

Config System Feature well known names

Variables

This section is empty.

Functions

func CurrentLogStatus

func CurrentLogStatus() string

func FormatCommitOrValErrors

func FormatCommitOrValErrors(err error) string

FormatCommitOrValErrors - pretty print commit / validation errors

These are somewhat verbose, and in the case of multiple errors for a single node, very repetitive. We print the path, then the error, then repeat the path (CLI format) for good measure.

func FormatConfigPathError

func FormatConfigPathError(err error) error

FormatConfigPathError - pretty print Exists() / Expands() errors for CLI

func FormatConfigPathErrorMultiline

func FormatConfigPathErrorMultiline(err error) error

FormatConfigPathErrorMultiline - pretty print multiline config path errors

Deal with various formats of set/delete 'configuration path' errors, which may or may not include 'Set failed' or 'Value validation failed'.

func FormatRpcPathError

func FormatRpcPathError(err error) error

FormatRpcPathError - pretty print RPC errors for the CLI

func FormatWarnings

func FormatWarnings(warns []error) error

func LoggingIsEnabledAtLevel

func LoggingIsEnabledAtLevel(level LogLevel, logType LogType) bool

func LoggingValueAndStatus

func LoggingValueAndStatus(logType LogType) (int, bool)

func MapLogLevelToName

func MapLogLevelToName(level LogLevel) string

func MapLogTypeToName

func MapLogTypeToName(logType LogType) string

func SetConfigDebug

func SetConfigDebug(logName, levelOrValue string) (string, error)

Types

type LogLevel

type LogLevel int
const (
	// Current log levels used in configd are Error (Elog) and Debug (Dlog).
	// Commit 'error' level logs (which might be better described as info)
	// are always on.
	//
	// Order must be least verbose (none) to most verbose (debug) so we can
	// check what is enabled by simple numeric comparison.
	LevelNone LogLevel = iota
	LevelError
	LevelDebug
	LevelLast // Keep at end for sizing slices etc.
)

func MapLevelNameToLevel

func MapLevelNameToLevel(level string) (LogLevel, error)

type LogType

type LogType int
const (
	// Any changes need to be reflected in cfgDebugSettings
	TypeNone LogType = iota
	TypeCommit
	TypeState
	TypeMust
	TypeLast // Keep at end so we can size slices
)

func MapLogNameToType

func MapLogNameToType(name string) (LogType, error)

type ValueType

type ValueType int
const (
	StringVal ValueType = iota
	IntVal
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL