cachetypes

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package cachetypes contains type definitions for caches in Porch.

Index

Constants

View Source
const DefaultDBCacheDriver string = "pgx"

Variables

This section is empty.

Functions

func IsACacheType

func IsACacheType(ct string) bool

Types

type Cache

type Cache interface {
	OpenRepository(ctx context.Context, repositorySpec *configapi.Repository) (repository.Repository, error)
	CloseRepository(ctx context.Context, repositorySpec *configapi.Repository, allRepos []configapi.Repository) error
	GetRepositories() []*configapi.Repository
	GetRepository(repository.RepositoryKey) repository.Repository
	UpdateRepository(ctx context.Context, repositorySpec *configapi.Repository) error
	CheckRepositoryConnectivity(ctx context.Context, repositorySpec *configapi.Repository) error
}
var (
	CacheInstance Cache
)

type CacheFactory

type CacheFactory interface {
	NewCache(ctx context.Context, options CacheOptions) (Cache, error)
}

type CacheOptions

type CacheOptions struct {
	ExternalRepoOptions        externalrepotypes.ExternalRepoOptions
	RepoSyncFrequency          time.Duration
	RepoOperationRetryAttempts int
	RepoPRChangeNotifier       RepoPRChangeNotifier
	CoreClient                 client.WithWatch
	CacheType                  CacheType
	DBCacheOptions             DBCacheOptions
}

type CacheType

type CacheType string
const (
	CRCacheType      CacheType = "CR"
	DBCacheType      CacheType = "DB"
	DefaultCacheType CacheType = CRCacheType
)

type DBCacheOptions

type DBCacheOptions struct {
	Driver     string
	DataSource string
}

type RepoPRChangeNotifier

type RepoPRChangeNotifier interface {
	NotifyPackageRevisionChange(eventType watch.EventType, obj repository.PackageRevision) int
}

Jump to

Keyboard shortcuts

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