databasecenter

package
v0.0.0-...-cd88763 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package databasecenter provides functionality to send metadata to Database Center.

Index

Constants

View Source
const (

	// MajorVersionKey is the key for the major version in metrics.
	MajorVersionKey = "major_version"
	// MinorVersionKey is the key for the minor version in metrics.
	MinorVersionKey = "minor_version"
	// NoRootPasswordKey is the key for the no root password signal in metrics.
	NoRootPasswordKey = "no_root_password"
	// ExposedToPublicAccessKey is the key for the exposed to public access signal in metrics.
	ExposedToPublicAccessKey = "exposed_to_public_access"
	// UnencryptedConnectionsKey is the key for the unencrypted connections signal in metrics.
	UnencryptedConnectionsKey = "unencrypted_connections"
	// DatabaseAuditingDisabledKey is the key for the database auditing disabled signal in metrics.
	DatabaseAuditingDisabledKey = "database_auditing_disabled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SendMetadataToDatabaseCenter(ctx context.Context, metrics DBCenterMetrics) error
}

Client for sending metadata to database center.

func NewClient

func NewClient(config *configpb.Configuration, commClient CommunicationClient) Client

NewClient creates a new database center client.

type CommunicationClient

type CommunicationClient interface {
	EstablishACSConnection(ctx context.Context, endpoint string, channel string) (*client.Connection, error)
	SendAgentMessage(ctx context.Context, agentType string, messageType string, msg *anypb.Any, conn *client.Connection) error
}

CommunicationClient is an interface for communication client.

type DBCenterMetrics

type DBCenterMetrics struct {
	EngineType EngineType
	Metrics    map[string]string
}

DBCenterMetrics is a struct for database center metrics.

type EngineType

type EngineType string

EngineType is an enum for the type of database engine.

const (
	// UNKNOWN  engine type.
	UNKNOWN EngineType = "UNKNOWN"
	// MYSQL engine type.
	MYSQL EngineType = "MYSQL"
	// POSTGRES engine type.
	POSTGRES EngineType = "POSTGRES"
	// SQLSERVER engine type.
	SQLSERVER EngineType = "SQLSERVER"
)

Jump to

Keyboard shortcuts

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