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 ¶
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.