dbservices

package
v0.0.0-...-7eb89d9 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AlwaysUseCacheKey = "always"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	PreCache() error
	LogMetadata(bindingID string, revision int, promLabels prometheus.Labels) (*model.LogMetadata, error)
}

type LogMetadataCached

type LogMetadataCached struct {
	model.LogMetadata
	ExpireAt time.Time
}

type MetaCacher

type MetaCacher struct {
	// contains filtered or unexported fields
}

func NewMetaCacher

func NewMetaCacher(db *gorm.DB, cacheDuration string) (*MetaCacher, error)

func (*MetaCacher) Cleaner

func (c *MetaCacher) Cleaner()

Cleaner - clean expired cache to ensure to not use too much memory This need to be called in a goroutine and do a kind of stop the world during cleaning sync map

func (*MetaCacher) LogMetadata

func (c *MetaCacher) LogMetadata(
	bindingID string,
	revision int,
	promLabels prometheus.Labels,
) (*model.LogMetadata, error)

func (*MetaCacher) PreCache

func (c *MetaCacher) PreCache() error

type Migration

type Migration struct {
	ID       string
	Migrate  func(db *gorm.DB, config *model.Config) error
	Rollback func(db *gorm.DB, config *model.Config) error
}

func GormMigration

func GormMigration() []*Migration

type Migrations

type Migrations struct {
	Config     *model.Config
	Migrations []*Migration
}

func (Migrations) ToGormMigrate

func (m Migrations) ToGormMigrate() []*gormigrate.Migration

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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