rpc

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditLn

func AuditLn(correlationId *string, v ...any)

AuditLn logs an audit message with the provided correlationId and message arguments. Audit messages are always logged, regardless of the current log level.

func CreateLogServer

func CreateLogServer() *grpc.Server

CreateLogServer initializes and starts a gRPC server for logging services. It sets up a TCP listener on the address specified by SentinelLoggerUrl, registers the LogServiceServer, and starts serving incoming connections.

Returns:

  • A pointer to the initialized grpc.Server if the server starts successfully.
  • Nil if there is an error in creating the listener or starting the server.

Errors:

  • If it fails to create the TCP listener, it logs the error and returns nil.
  • If the server fails to start serving, it logs the error but still returns the server instance, which might not be in a fully operational state.

Usage:

server := logger.CreateLogServer()
if server == nil {
    fmt.Println("Failed to start log server")
} else {
    fmt.Println("Log server started successfully")
}

func DebugLn

func DebugLn(correlationId *string, v ...any)

DebugLn logs a debug message with the provided correlationId and message arguments if the current log level is Debug or lower.

func ErrorLn

func ErrorLn(correlationId *string, v ...any)

ErrorLn logs an error message with the provided correlationId and message arguments if the current log level is Error or lower.

func FatalLn

func FatalLn(correlationId *string, v ...any)

FatalLn logs a fatal message with the provided correlationId and message arguments. The application will exit after the message is logged.

func InfoLn

func InfoLn(correlationId *string, v ...any)

InfoLn logs an informational message with the provided correlationId and message arguments if the current log level is Info or lower.

func SentinelLoggerUrl

func SentinelLoggerUrl() string

SentinelLoggerUrl retrieves the URL for the VSecM Sentinel Logger from the environment variable VSECM_SENTINEL_LOGGER_URL. If this environment variable is not set, it defaults to "localhost:50051".

This url is used to configure gRPC logging service, which enables VSecM Sentinel's `safe` CLI command to send audit logs to the container's standard output.

func TraceLn

func TraceLn(correlationId *string, v ...any)

TraceLn logs a trace message with the provided correlationId and message arguments if the current log level is Trace or lower.

func WarnLn

func WarnLn(correlationId *string, v ...any)

WarnLn logs a warning message with the provided correlationId and message arguments if the current log level is Warn or lower.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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