Skip to main content

RootOptions

No overview available.

Attributes

AttributeTypeDescription
Scopepromutils.ScopeDefines the scope for Prometheus utilities, affecting how metrics are collected and reported.
Store*storage.DataStoreHolds a pointer to the data store, used for persistent storage and retrieval of data.

Methods


executeRootCmd()

@classmethod
def executeRootCmd() - > error

Executes the root command. This method is typically the entry point for the application's command-line interface.

Returns

TypeDescription
errorAn error if the command execution fails, otherwise nil.

UploadError()

@classmethod
def UploadError(
ctx: context.Context,
code: string,
recvErr: error,
prefix: storage.DataReference
) - > error

Uploads an error document to a specified storage location. This method is used to persist details about an error that occurred during an operation.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the upload operation, allowing for cancellation and timeouts.
codestringThe error code associated with the encountered error.
recvErrerrorThe actual error object that was received and needs to be uploaded.
prefixstorage.DataReferenceThe storage prefix where the error document should be uploaded.

Returns

TypeDescription
errorAn error if the upload operation fails, otherwise nil.

initConfig()

@classmethod
def initConfig(
cmd: *cobra.Command,
_: []string
) - > error

Initializes the configuration for the command-line application. This method sets up the necessary configuration parameters before command execution.

Parameters

NameTypeDescription
cmd*cobra.CommandThe Cobra command for which the configuration is being initialized.
_[]stringUnused parameter, typically representing command-line arguments.

Returns

TypeDescription
errorAn error if configuration initialization fails, otherwise nil.