cachetypes

package
v1.5.10-test Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 CRCacheOptions

type CRCacheOptions struct {
	MaxConcurrentLists       int
	ListTimeoutPerRepository time.Duration
}

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
	FindAllUpstreamReferencesInRepositories(ctx context.Context, namespace, prName string) (string, error)
	ListPackageRevisions(ctx context.Context, filter repository.ListPackageRevisionFilter) ([]repository.PackageRevision, error)
	StreamPackageRevisions(ctx context.Context, filter repository.ListPackageRevisionFilter, callback func(repository.PackageRevision) error) 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
	CRCacheOptions             CRCacheOptions
}

type CacheType

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

type DBCacheOptions

type DBCacheOptions struct {
	Driver             string
	DataSource         string
	MaxConnections     int
	MaxIdleConnections int
	MaxConnLifetime    time.Duration
	MaxConcurrentSyncs int
}

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