repo

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package repo provides implementations for resource repository interfaces. This package includes implementations for repositories that can be extended to fit specific use cases. It supports transaction management and context-based database operations.

Index

Constants

This section is empty.

Variables

View Source
var (
	StorageWriteFailures = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "storage_write_failure_total",
			Help: "Total number of storage write failures.",
		},
		[]string{"resource_type", "namespace", "resource_name", "action"},
	)
)

remoteWriteStatsOnce is used to ensure that the initialization of remote write statistics happens only once. This is useful to avoid race conditions and ensure thread-safe initialization of metrics or other related resources.

Functions

func NewInMemoryResourceRepository

func NewInMemoryResourceRepository(clock types.TimeProvider) (types.ResourceStore, error)

NewInMemoryResourceRepository creates a new in-memory resource repository.

func NewResourceRepository

func NewResourceRepository(clock types.TimeProvider, db *gorm.DB) (types.ResourceStore, error)

NewResourceRepository creates a new resource repository with the given clock and database connection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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