engine

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: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again"
)

Variables

This section is empty.

Functions

func NewWatcherManager

func NewWatcherManager() *watcherManager

func PushPackageRevision added in v1.5.0

Types

type CaDEngine

type CaDEngine interface {
	// ObjectCache() is a cache of all our objects.
	ObjectCache() WatcherManager

	UpdatePackageResources(ctx context.Context, repositoryObj *configapi.Repository, oldPackage repository.PackageRevision, old, new *porchapi.PackageRevisionResources) (repository.PackageRevision, *porchapi.RenderStatus, error)

	ListPackageRevisions(ctx context.Context, repositorySpec *configapi.Repository, filter repository.ListPackageRevisionFilter) ([]repository.PackageRevision, error)
	CreatePackageRevision(ctx context.Context, repositoryObj *configapi.Repository, obj *porchapi.PackageRevision, parent repository.PackageRevision) (repository.PackageRevision, error)
	UpdatePackageRevision(ctx context.Context, version int, repositoryObj *configapi.Repository, oldPackage repository.PackageRevision, old, new *porchapi.PackageRevision, parent repository.PackageRevision) (repository.PackageRevision, error)
	DeletePackageRevision(ctx context.Context, repositoryObj *configapi.Repository, obj repository.PackageRevision) error

	ListPackages(ctx context.Context, repositorySpec *configapi.Repository, filter repository.ListPackageFilter) ([]repository.Package, error)
	CreatePackage(ctx context.Context, repositoryObj *configapi.Repository, obj *porchapi.PorchPackage) (repository.Package, error)
	UpdatePackage(ctx context.Context, repositoryObj *configapi.Repository, oldPackage repository.Package, old, new *porchapi.PorchPackage) (repository.Package, error)
	DeletePackage(ctx context.Context, repositoryObj *configapi.Repository, obj repository.Package) error
}

func NewCaDEngine

func NewCaDEngine(opts ...EngineOption) (CaDEngine, error)

type EngineOption

type EngineOption interface {
	// contains filtered or unexported methods
}

func WithBuiltinFunctionRuntime

func WithBuiltinFunctionRuntime(imagePrefix string) EngineOption

func WithCache

func WithCache(cache cachetypes.Cache) EngineOption

func WithCredentialResolver

func WithCredentialResolver(resolver repository.CredentialResolver) EngineOption

func WithFunctionRuntime

func WithFunctionRuntime(runtime fn.FunctionRuntime) EngineOption

func WithGRPCFunctionRuntime

func WithGRPCFunctionRuntime(options GRPCRuntimeOptions) EngineOption

func WithReferenceResolver

func WithReferenceResolver(resolver repository.ReferenceResolver) EngineOption

func WithRepoOperationRetryAttempts added in v1.5.4

func WithRepoOperationRetryAttempts(retryAttempts int) EngineOption

func WithRunnerOptions

func WithRunnerOptions(options fnruntime.RunnerOptions) EngineOption

func WithRunnerOptionsResolver

func WithRunnerOptionsResolver(fn func(namespace string) fnruntime.RunnerOptions) EngineOption

func WithSimpleFunctionRuntime

func WithSimpleFunctionRuntime() EngineOption

func WithUserInfoProvider

func WithUserInfoProvider(provider repository.UserInfoProvider) EngineOption

func WithWatcherManager

func WithWatcherManager(watcherManager *watcherManager) EngineOption

type EngineOptionFunc

type EngineOptionFunc func(engine *cadEngine) error

type GRPCRuntimeOptions added in v1.4.0

type GRPCRuntimeOptions struct {
	FunctionRunnerAddress string
	MaxGrpcMessageSize    int
	DefaultImagePrefix    string
}

type ObjectWatcher

type ObjectWatcher interface {
	OnPackageRevisionChange(eventType watch.EventType, obj repository.PackageRevision) bool
}

PackageRevisionWatcher is the callback interface for watchers.

type WatcherManager

type WatcherManager interface {
	WatchPackageRevisions(ctx context.Context, filter repository.ListPackageRevisionFilter, callback ObjectWatcher) error
}

ObjectCache caches objects across repositories, and allows for watching.

Jump to

Keyboard shortcuts

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