cachetypes

package
v1.5.1 Latest Latest
Warning

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

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

Documentation

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
}
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
	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